The exact shelf life for home-brewed beer is not known as there are a large number of influencing factors. Most of the time, this question is irrelevant because home-brewed beer gets consumed quickly enough that it doesn’t matter. If you have have taken the proper sanitary steps and your beer has an alcohol content of at least 5%, then you can assume in cold and dark storage that you can keep your home brew drinkable for 3 to 6 months.
The more alcohol your beer has, the longer it will last, so in some cases you can keep home brew beer for up to a year or more. Beer with alcohol content of 8% can be treated the same as a good red wine and it will mature in a cellar. A barelywine is a great example of this. This is also common with dark malty aromatic beers (stout or porter) and is often recommended by brewers.