There is no known maximum energy for a photon. Every definition of gamma rays is something like “a photon with an energy of Y or higher”, where Y is some arbitrary cutoff between X-Rays and gamma rays. The key there is the phrase “or higher”. So if you take a gamma ray and blueshift it (which is perfectly possible), then what you have will be even higher energy, but it would still get the label “gamma ray”. This says nothing about physics, but only about human terminology.

Note that I said there’s no *known* upper limit. It’s possible that there is an upper limit, but that we just don’t know it yet. If this is in fact the case, then the simplest guess for what that upper limit might be is the Planck energy. The Planck energy, like the Planck mass, Planck length, Planck time, Planck temperature, etc., is a quantity which is obtained by cobbling together Newton’s constant (G, which relates to the strength of the graviational field), Planck’s constant (h, the quantum of action or angular momentum), and Einstein’s constant (c, the speed of light and of any other massless particle). For any system involving the Planck scales, both General Relativity and Quantum Mechanics are likely to be relevant, but those theories as we understand them are incompatible. In order to understand what happens at the Planck scales, we would need a theory of quantum gravity, which we don’t yet have (string theory is one candidate for the theory of quantum gravity, and it looks a bit promising, but it’s neither well-established nor well-developed). It may be that once we have a theory of quantum gravity, it’ll tell us that the Planck length or something close to it is the shortest length possible in nature. But it may also not tell us that, and we don’t have any way yet of knowing one way or the other.