In a glass bottle with an air-tight lid, the limiting factor is any nasties that got in. An infection free beer will be OK for a long time, but will stop improving after a few weeks or months, depending on type and ABV.
In plastic or in a barrel, another limiting factor is oxygen, which will eventually penetrate a PET bottle, or a wooden /plastic barrel. With a barrel the main problem, though is drawing in air through the tap if there is not sufficient pressure in the barrel.