If you were to construct a box with perfect mirrors on all sides, and would emit some photons in to that, would the light bounce infinitely? Sorry of this is a stupid queston, i'm not a physicist ;)
The answer is if there would be a box like that, even with a photon in it, when the photon interacts with the atoms in the mirror, three things could happen to the photon:
elastic scattering, the photon keeps its energy and changes angle
inelastic scattering, the photon gives part of its energy to the atom and changes angle
absorption, the atom gives all of its energy to the atom and the valence electron that absorbs it moves to a higher energy level as per QM
Now if the photon bounces a lot, all three will happen, and since the absorption too, in that case the photon might be re-emitted or not. If it is re-emitted it might be re-emitted in another direction, outside the box (quantum tunneling).
So for your question, it will not bounce forever, either because absorption, or because as per QM, the wavefunction of the photon will describe the photons position in space, and after a while it will be outside the box (quantum tunneling).
And as per the comment, you cannot make perfect mirrors, that would just elastically scatter, there will be inelastic scattering and absorption too.