Electron affinity is the energy change that occurs when an electron is added to a neutral atom or ion in the gas phase.