We are in charge of the aging process. Commercially bought beer will be bottled after "aging" or whatever chemical process they call aging.
So arguably as a mega-homebrew expert you would age your beer for 6, 12, 18 weeks until you are happy it has met it's full potential, then you would label it with that date and continue to sample it every week until it's taste starts to change from "ideal" to "less than ideal". You'd work out how long that was and in future label the beer with a "best before" based on your findings. I expect that date would be many months beyond "ideal" though.
Judging (guessing mostly) by a few cans and bottles I have here, from shelf to best before on commercial beers is at least 4 months.
I have heard estimates for home brew going beyond "ideal" in anything from 6-12 months, but that includes the initial aging of 1-3 months.