A keg is not a measurement, but a way of storing beer. @gooch, you are thinking of the unit of measure known as a barrel. In the United States a barrel of beer is 31 gallons. A half barrel, or what most people think of as a keg, is 15.5 gallons as @gooch mentioned. A gallon is 128 ounces, or 10.67 12oz beers. So a 15.5 gallon keg would hold 165.33 beers… but you’re going to have waste and spillage and foam.
So, @gooch and @johnpowell were both pretty much spot on… I just wanted to clear up the misunderstanding about keg vs. barrel.