When they aren’t waves.
Nope. Incorrect.
Photons are what they are, and they always are what they are.
Under certain conditions their state vector can collapse into experimentally measurable property (eigenstate of an observable) that can be described as "wavelike behavior." Under other conditions, the state vector collapses on measurement into eigenstates that imply particle like behavior.
But in either case, they're always photons.