jcphoto: some basics:
you'll find a lot of paper and cloth hats in department / discount stores these days. never ever wear one of this with any kind of 'dressy' outfit. wearing them with jeans and a polo shirt is...a look, I guess.
those aside, you can kinda boil it down quite easily for seasons: there's wool/felt hats, which you wear in winter, spring and fall, and straw hats, which you wear in summer. (there's some opinions earlier in the thread about exactly when to switch from felt to straw, but I just tend to base it on the weather). If you want to keep it simple, your basic 'dress' hats are fedoras and panamas. you can get fedoras and panamas with different sizes of brim and different crown shapes; none of these is really more formal than the others, or more suited to any particular occasion than any other, it's purely a style choice. Colors of both the hat and the hat band are mostly just a question of co-ordination, and in terms of appropriateness / formality, pretty much follow the rules for suit colors (black is formal, grey and brown are safe, anything outside of that is getting a bit peacockish - blue hats fall on the peacockish side of things, unlike blue suits).
you can start broadening out into different styles and stuff once you have the basics. The homburg is an older style than the fedora, for instance - you can wear it today, but it can be a slightly tricky look to pull off, a fedora is safer. black homburg is correct with black tie if you're going to wear a hat with it. The bowler / derby is in kind of a similar position to the homburg - it's a dress hat which is now more unusual and hence trickier to wear than the fedora. In England it has certain social / class / job implications which make it a particularly tricky option for experts (and natives!) only, but this isn't such a problem outside of England. (though in America you might look like you just stepped out of a vintage Western). the boater is an alternative summer style to the panama, and again, somewhat less common these days - there's a big danger of looking costume-y in a boater, even more so than any hat :)
there's a whole sub-genre of Western/Australian style hats, which are probably best reserved for locals or at least worn with an 'appropriate' outfit, or else you risk looking like a politician appearing at a county fair. then you have soft, brimless hats like the flat cap and beret, which I'm mostly going to plead ignorance on as I don't like them and never wear them.
for sizing, mainly just worry about the circumference, this is the only thing specified on hats. Good hats will be sized either in the U.S. style (which ranges from around 6 (tiny) through 8 (huge) and goes down to 1/8th increments, most people fall somewhere in the 7s) or European style (which is integers up in the 40s/50s, IIRC). Both these are derived from actual measurements somehow, but I forget how, and it's easiest just to try on a few hats until you find your size, and that is your size. It's very easy to know if a hat fits - it shouldn't be so tight that it's squeezing your forehead, or so loose that it's sitting on your ears. You want the happy medium between those two points - lightly resting just above your ears. Hats from different makers will vary a little bit, but you'll usually always be within the same 1/4 range or so (I'm always either 7 1/8 or 7 1/4). Crown height thing I mentioned was kind of a special with that 'Indiana Jones' hat - aside from that, most hats will have reasonably similar crown heights and it shouldn't be a big problem. If a hat is sized S/M/L this is a good indicator that it's not a great hat - rather like sport coats in that regard, really. Having said that, a company called Brixton makes a line of wool felt fedoras that are sized S/M/L which I quite like as everyday beaters, and which don't look quite as dressy as 'proper' dress fedoras, which can be useful for semi-casual outfits or whatever.
Do certain hats lend themselves better to certain head shapes, well technically speaking I'm sure the answer is 'yes', but I don't know the details. I just tend to think of it as certain hats and styles just don't work for certain people. See above - brimless hats mostly just don't work for me. A couple of things to keep an eye on for fedora-type hats are the brim size and band size; these make a significant difference to the appearance of the hat and you'll probably find that you generally look better in _either_ wide-brimmed _or_ narrow-brimmed hats. I just figure this out by experimentation myself. As a big generalization, a wide brim is more of an 'old-fashioned' look than a narrow brim, but beware the super-stingy brim that was kind of fashionable for terrible musicians a few years back, unless you want to look like a terrible musician from a few years back.
Really, the best thing to do is get ye to a local hat shop and experiment; try on a bunch of hats. If you have a good local hat shop there will likely be staff there who will be happy to give you a whole bunch of advice. Wear something reasonably neutral like a mid-grey suit or something, or just whatever type of outfit you're interested in wearing a hat with. If you want to go for a solid first purchase that's seasonally appropriate, get a classic panama with a medium sized brim and a conservative band, like black. Summer's coming, and a classic panama hat can look pretty nice with just about any outfit; I wear mine with all sorts of stuff, all summer long.