For a long face, wide brimmed hats work best. Whether it's a sun hat, western cowboy style, or any other wide brim hat, the width of the brim can help balance out the look of a long face. Avoid beanies.
For a round face, you're going to want a hat with sharp angles to balance out any soft facial features. Fedora's are best, or perhaps a sharply styled top hat. Beanies are an acceptable style as well.
A heart shaped face looks great with a shorter, angled brim. This means top hats of any height, and fedoras look the best as the top of your face tends to be wider, and your jaw narrower. Avoid floppy, wide brimmed hats.
If you have an oval face, lucky you! An oval face looks good in nearly every style of hat. Treat yourself!
For a diamond shaped face, interestingly enough, it's less important what kind of hats you wear, but rather you should pay attention to how you wear them. Much like a heart shaped face, a diamond shaped face is wider at the top, and has a narrower jawline. This means it's important to wear a hat farther back on your head, to prevent having the appearance of a shortened face. Something with a shorter crown, like a low crown top hat or fedora is best.