To quote Michael Jackson: "If you see a beer, do it a favour, and drink it. Beer was not meant to age." Generally, that is true. However, some beers that are strong and/or highly hopped must age to reach their full flavour potential.
How a beer is conditioned and handled has a great effect on its shelf life. Beer conditioned in the bottle or cask still contains live, active yeast and should be drunk as soon as possible. Most larger scale, commercial beers have been filtered or pasteurised to remove/kill the yeast and stabilise the product for the longer storage times encountered in the retail world. In any case, stored beer should never be exposed to heat or strong light.