Electron affinity is a measure of how much an
atom wants to gain an electron, becoming an anion. Unfortunately 2
different definitions are used: intro textbooks use 1 definition and
everyone else uses the other! I think you should use the standard
advanced definition, according to which electron affinity EA =
IE0, the energy of this reaction:
A−(g) → A(g) + e−(g)
The other definition just has the opposite sign, because it's the energy of this
process:
A(g) + e−(g) → A−(g)
Like ionization energy, electron affinity tells us how likely an atom is to steal electrons from other atoms, or just convince them to transfer their loyalty partially.
It pretty much follows the same pattern you would expect based on ionization energy. If the new electron goes into an orbital that feels high effective nuclear charge, gaining an electron is good. If it goes into an orbital that is in a higher shell or subshell, or that feels low effective nuclear charge, gaining an electron is bad. The only other thing is that it's easier to add electrons to bigger atoms, because then they can spread out and not have so much electron-electron repulsion. For this reason, chlorine has more favorable EA than fluorine (in the gas phase! fluorine is still much more reactive.)
Go to Ptable's electron affinity page. See the general trend (bigger middle and right) with big effects at the end and middle of each block (noble gases, mercury family, alkaline earths, nitrogen, manganese).