The energy of a photon of light is given by, E = hν
‘h’ is Planck’s constant and ‘ν’ is the frequency.
When there is a change in medium the frequency of light remains constant and the wavelength of light changes. Thus, the energy of light remains same when it moves from one medium to another.