depends, typically mass produced beer has all the helpful, healthy enzymes and bacteria filtered out when it is bottled, drastically reducing its ultimate shelf-life but with little need for temperature control to get normal longevity out of it
bottle conditioned
(or at least a segment of "craft") beer would have a virtually unlimited shelf-life, provided temperature remains within norms
(i.e. temperature control typically needed) and with hops being a natural preservative your pale ales and IPAs have plenty of protection by default
then you get your barrel aged or even Lambic beers that live in a barrel for about a year or more minimum before it ever sees a bottle
so it depends, mass produced pisswasser spoils fast, real beer just continues to mature, like wine