A photon is intrinsically a moving thing. If it hits something, it ceases to exist as such and its essence (some energy, some momentum, some spin), together with that of whatever it hits, is rearranged into a new combination of particles subject to various conservation laws. The new combination might still include a photon (as with many scattering events), but it's probably better to imagine the old photon as annihilated and a fresh one with different properties being created. In the case of the photoelectric effect the photon disappears entirely and its energy shows up as kinetic energy of the emitted electron.