When there are pi bonds as well as the sigma bonds, and therefore a double or triple bond. When it can change where that double bond is you can draw a resonance structure. Ozone, O3, has two resonance structures because you can rearrange the bonds in it.