Photons are elementary particles, and as such have to obey the algebra of special relativity and the mathematics of quantum mechanics. A single photon's mass is zero , and can only have an energy-momentum four vector and spin 1. In the observations and experiments it has been proven that a confluence of photons build up the classical electromagnetic wave, whose frequency is related to the photons energy by $E_(photon)= hν$ where $h$ is planck's constant.
The experimental and theoretical study of electrodynamics at the quantum level is well validated, and the calculations where photons are concerned are carried out with the Feynman diagrams for the reaction. So your:
what is the required magnetic field (in Teslas) to reduce X amount of Joules from a photon?
has the answer that a photon's energy can be changed only with interactions and the interaction with the magnetic field will be with a virtual exchange of a photon with complicated Feynman diagrams that would have to be calculated for the specific case of the specific magnetic field, no blanket number will come out.
Gravitational change of frequency is a different case. The theory of General Relativity has to be invoked and as it is not yet definitively quantized a nomenclature is being used that mixes up classical electromagnetic wave language with observations of electromagnetic waves in strong gravitational fields. At the quantum level, it is not the "same" photon that arrives changed in our earth observations. If it has a different energy than it started with, it must have interacted, and by definition of photon ( its energy is the main identity) it is a new photon. If gravity becomes quantized, the original photon must have interacted with the gravitational field with an exchange of a graviton. Otherwise one should keep talking of classical electromagnetic waves and their interactions.