One very important criterion that @phoebus briefly mentioned is brewing process. The first big distinction is ales versus lagers. Lagers are stored in cold rooms during the production process, and I find they're lighter on average than ales, certainly in terms of flavour, and often in terms of colour as well.
After that, there are lots of less-black-and-white brewing differences between styles of beer. For example, IPAs generally have a considerable amount of hops added, but that's not always true. Hefeweizen has considerable amounts of yeast left after brewing, giving it its cloudy appearance. The list goes on and on.
Personally, I think that the traditional names for beer styles (stout, lager, IPA, wheat beer, etc.) are based a lot on brewing process, and in the case of something like lager or wheat beer, the name clearly shows the brewing origin. However, more and more brewers are pushing the boundaries of these styles, so when it comes to things like appearance and flavour, which are ultimately the things that matter, two beers from different brewing styles can be quite similar, or two beers from the same brewing style can be quite different.