Electron affinity is the energy change when an electron is added to an atom to form an anion (negatively charged ion).
Generally, electrons tend to repel one another. As a result, when an electron is added to an atom it can cause some atoms to become highly unstable. Because of this, electron affinity measures the attraction an atom has for an electron. If this attraction is strong, then, the ion of the atom is more likely to be stable after the addition. And if the attraction is weak, then, the ion of the atom is more likely to be unstable after the addition.
Two sign conventions are used to report electron affinity. One convention uses positive values, while the other uses negative values. Here, we will use negative values, and here is a table showing the electron affinities of some elements:
As you can see, when an electron is added to a fluorine (F) atom in the gaseous state the electron affinity is -328 kJ/mol. We can write this addition as:
The large negative value shows that fluorine atom easily accepts an electron. And if you compare the electron affinity of fluorine to the electron affinities of the rest of the elements in group 17, you will notice that they all have a strong attraction for an electron. This strong attraction makes sense because fluorine and the rest of the halogens just need a single electron to achieve an octet (8) of valence electrons similar to that of the noble gases (group 18).
Also, on the table, you will notice that the noble gases (group 18) all have electron affinities greater than zero (positive values). These positive electron affinity values mean that the negative ions of these atoms are less stable than the neutral atoms. For this reason, the electron affinities of such ions are difficult to measure experimentally, because of this, we simply write their electron affinity values as being greater than zero.
Generally, electron affinity values become more negative as you move your eyes from the left of the periodic table toward the halogens (group 17). And as you recall, these halogens only need one electron to achieve a stable electron configuration similar to that of the noble gases. For this reason, they love electrons and will easily accept one from another atom to achieve it.
If you want to learn more about ionization energy, click here.