Most beers have a shelf life, but what that life is varies widely. IPAs, APAs, Hefeweizens, Witbiers, anything that is best young and fresh I try to have consumed 2 months after brew day (maybe 2 weeks in the fermenter, 2 weeks in the bottle, and then 4 weeks drinking it). Going longer is ok, but the hops drop off quickly after that, or with wheat beers they can go pretty dull.
Others will keep for a VERY long time. Most non highly-hopped or wheat beers beers are usually just fine for a few months to a year (although most will show age towards the older end). Some beers, particularly the darker, the stronger, and especially the sour, will keep for a very long time. Lambics in particular can be good for decades, and Barleywines and Imperial Stouts almost as long.