Electrons in atoms and molecules are generally confined to specific volumes of space called orbitals. Most of these orbitals are between two different atoms (if the electrons are involved in a chemical bond) or around an individual atom (for electrons not involved in a chemical bond). In some types of chemical bonds, however, the orbital gets spread out between three or more atoms, sometimes encompassing an entire molecule. Because the electrons are not localized simply between two atoms but spread across a much larger area, we say that these electrons are "delocalized." If these electrons are giving the molecule an overall negative charge, delocalizing the electrons across the molecule delocalizes the negative charge across the entire molecule. Electrons must almost always be in pi bonds for them to become delocalized but not all electrons in pi bonds are delocalized.
The phenomenon of delocalization explains how molecules can act as if they have different arrangements of electrons (i.e. different resonance structures). As orbitals spread across a larger area, they become more stable (i.e. the energy of their ground state decreases), which is why resonance tends to be a stabilizing factor in molecular structures.