First, consider a baseball that is thrown upwards. As it rises, the baseball gains potential energy and loses potential energy.
Suppose you have two identical clocks. Dig a hole straight to the centre of the Earth, leave one clock at the centre of the Earth, and hoist yourself back to the surface of the Earh, where you left the other clock.
With one eye, look in a telescope that is trained on the clock at the centre of the Earth. With the other eye, watch the clock on the surface beside you. You will see the second hand on the clock at the centre move more slowly than the second hand on the clock beside you.
Why? Because, like the baseball, photons, as they rise from the centre to the surface, lose kinetic energy. Unlike the baseball, photons always move at the speed of light, so they can't lose kinetic energy by slowing down. Photon energy is proportional to frequency, so the frequency of the light decreases as it rises.
However, frequency is like ticks of a clock. So the image of central clock that you see is slower, because the photons lost energy as the rose from the centre to your eye.