Beer in a beer keg can last for 6 months or longer but after a few months or 60 days the beer is not at fresh as it would be.
So if you want the best tasting and freshest beer you should drink the beer in the keg within a few months.
But even after that the beer is still okay to drink but you may not get as much enjoyment out of the beer in the keg.
Also if your beer in the beer keg is pasteurized beer, then the beer in the beer keg will likely last for at least three months, maybe even six if you store it at the correct temperatures.
But it's best to drink it within 6 months and not leave it longer than that.