The shift of the wavelength of a photon to a longer wavelength when traveling out of a gravitational well