Good question, lots of answers.
Grinding is very important and often gets overlooked; this begins with the fact that many of us end up buying pre-ground coffee. How do we know if that coffee was ground specifically for our brewing method? We don't. Most of the time, a coffee producer will grind the pre-packaged stuff at a medium, middle of the road setting, likely giving you a medium, middle of the road result--bor-ring!
The best case scenario is to buy your coffee in whole bean form at your favorite coffee house and ask them to grind at your preferred setting. If you buy your coffee at a place that doesn't offer that service you can always take it to a coffee shop and if you buy a cup of coffee and ask nicely, they'll probably grind your beans for you. Notice I didn't say grind at home; I know, I know, grinding at home makes you a coffee-pro and generally amazing--but for my unorthodox opinion on this subject, read this.
So how does grind matter and what grind should you get?
Simply, grind controls the speed at which water passes over coffee pieces; thus, grind controls extraction. The smaller the pieces, the slower water can pass through it--more water spends more time in contact with more coffee surface. Too high of a surface to water to time ratio gives you over extracted coffee (astringent, acidic, bitter, unpalatable); too low of the same ratio gives you under extracted coffee (weak, sharp, under-flavored, lacking in complexity and structure).
Here are some basic settings:
If you have a plain old flat bottomed filter brewer you need the generic "drip coffee" setting. Most American made grinders put this around a number 7 and generally label it "drip coffee". The grind should look like the consistency of coarse sand or grits (if you know what that looks like).
Cone shaped filters are more efficient at letting water pass over and through coffee grinds and the process must be slowed in this situation--I will note that cone filters tend to make a better extraction than flat filters because more water touches all of the coffee and the ratio mentioned above is closer to ideal. To slow down the cone extraction process you need a slightly finer grind; once again it will be labeled "cone filter" or around number 5.
French press and other manual, filterless brewing systems need a coarser grind, mainly because you want to reduce sludge in the brew pot but also because the coffee stays in contact with the water and you quickly run the risk of over extraction--coarser grind slows this process. This grind should look the consistency of rock salt that you would throw on your walk way.
Espresso machines and Bialetti pots require a fine grind because you are drawing an extraction from a very small amount of coffee in a short period of time, therefore you need to maximize the surface to water to time ratio. There is a difference between Turkish grind and fine espresso grind. Turkish grind is pure powder--about the consistency of cornstarch--and it will basically liquify giving you Turkish coffee (or what I call sludge). This is does NOT espresso make says I. Espresso grind has the consistency of fine corn meal and is still allowing a pass-through extraction. Ideally, if you dropped the cash to buy a real espresso machine, you sprung for a grinder as well and in that case, you just need to find a coffee pro to teach you how to adjust it. If you have a "toy" espresso machine, good luck and best wishes to you.
This may all seem a bit ridiculous, I know, its just ground coffee right? Wrong; but as the venerable Lavar Burton would say, "you don't have to take my word for it!" Get enough coffee to brew a batch in whatever you use and have it ground on the other end of the spectrum from what you need. Brew the coffee and then compare to the correct method. I guarantee you'll see a pretty drastic difference--from there it is, as always, all up to your tastes.