There are a lot of factors. Wheats and IPA's are better when fresher and should be drank young.
Big, complex beers like Imperial Stouts are better aged. A couple months ago I had one brewed in 2007 and it was AMAZING!
Your process also makes a difference. The more oxygen you introduce during bottling, the sooner your beer will go skunky. I always use bottle caps with a lining that absorbs O2. They aren't much more than regular caps and give me a little more confidence that the beer is going to still be good by the time I get to it.