Corn's popularity as a vegetable side dish in the U.S. is a bit misleading, because it's fundamentally a grain. The juicy kernels that grace your dinner plate are simply immature seeds, and if left to fully ripen on the stem they become as hard and dry as any other grain. Once they reach that point they can be milled into cornmeal or numerous other products, including corn flour and cornstarch. The two are different products, and have different uses.
The Whole Grain
Like any other whole grain, corn is made up of several parts. The outer white, yellow or blue layer is its bran. The germ, at the narrow end of each grain, contains its corn oil and many of the vitamins. Most of the kernel's bulk is its endosperm, which is made up primarily of starches and sugars. Cornmeal is the whole grain, ground coarsely or finely for cooking and baking purposes. Corn flour is also the whole grain, but ground to a finer, floury texture. It can be used a number of ways, but it's typically added to breads, muffins and other baked goods to lend a hint of color and corn flavor.
The Refined Starch
Cornstarch is a very different thing. It's made by separating out the bran, germ, sugars and proteins from the kernels, and processing them separately into products such as corn syrup and corn oil. The remaining starch is a very fine, pure white powder with no remaining color or flavor. It has thousands of industrial uses, but in the home kitchen it's primarily used as a thickener. If you whisk cornstarch into cold water, then stir it into a hot liquid, it thickens almost instantly to make a sauce with a beautiful sheen and translucent appearance.
Confusingly, in the United Kingdom and other parts of the English-speaking universe, cornstarch is referred to as cornflour. If your shelves contain cookbooks by British authors, or if you frequent the websites of English celebrity chefs, it's something to be aware of. If you see a reference to cornflour and it's used as a thickener, the recipe almost certainly means cornstarch.
Then There's Masa
Masa harina, or masa flour, is another form of corn flour you'll see frequently. It's made from corn that's been soaked in a strong alkaline solution, and then dried and ground. This process -- called nixtamilization -- changes the corn, freeing up B vitamins and other nutrients and making them easier for your body to absorb. You can use masa flour in your baked goods, like regular corn flour, but it's primarily used in Latin cookery. It's the main ingredient in corn tortillas, tamales, arepas and other Central and South American standards.