The time it takes to cook corn kernels depends on how well done you want the corn kernels to be when cooked.
At most it takes 25 minutes to cook the corn kernels.
If you're sauteing the corn kernels it takes around 15 to 25 minutes and if you boil the corn kernels it takes around 20 minutes.
Boiling corn on the cob also takes around 20 to 25 minutes once the water gets boiling.
For me when I cook corn kernels in a skillet 15 minutes of cooking time usually gets them done enough to my liking.