Pretty long I'd say, keep it sealed and you'll be fine. They say homebrew can be stored up to a year before it starts to go bad.
I don't know who "they" are, but properly stored beer doesn't "go bad" unless your sanitization is weak. The character of a beer may change (an IPA may become simply a pale ale as the hoppiness fades,) but that doesn't mean the beer is undrinkable.
Beers have lasted and been drinkable for hundreds of years in bottles, if stored properly. Our own Mbowenz recently tried a beer that was brewed in 1852. There are still drinkable bottles brewed for Napoleon.
Beer is really no different than wine, homebrew or otherwise. Properly stored it can last and be drinkable for 100s of years.
To put it in perspective, in the Dec 07 Zymurgy Charlie Papazian reviewed bottles of homebrew going back to the first AHC competition that he had stored, and none of them went bad, some had not held up but most of them he felt were awesome...We're talking over 20 years worth of beers.
This is a great thread about one of our guys tasting 4-5 years of his stored brew.
https://www.homebrewtalk.com/f14/revisiting-my-classics-160672/
And I brewed an og 1.150, 150 IBU barleywine that I won't be opening for 5 years.
Not to mention the fact that there are vertical tasting for certain beers like Stone epic, where people collect each years beer and then sample a flight of them going back in time.
I just had this expericence not too long ago...
We tried 48 year old beer today. One was interesting and drinkable, and one was gnarly.
Now this isn't saying a beer won't change, or lose some of it's character, but still a drinkable beer. Gravity and storage conditions are the two bigger factors. But beer isn't as short lived as for example Budweiser with their silly born on dates, would have folks believe.