Electron affinities are generally most favourable for elements with high ionization energies. The electron affinity is the potential energy change of the atom when an electron is added to a neutral, gaseous atom to form a negative ion. So the more negative the electron affinity the more favourable the electron addition process. Not all the elements form stable negative ions in which case the electron affinity is zero or even positive.
Electron affinity increases upward through times of a periodic table for the groups and from left to right, because the electrons added to the energy levels get nearer to the nucleus, making the nucleus and its electrons more attractive. As the principal quantum number increases, the size of the orbital increases and the affinity for the electron is less.
The value of electron affinity usually becomes less negative on descending a group of the periodic table. Electrons are added increasingly farther from the nucleus, so the attractive force between the nucleus and electrons decreases. The overall trend across a period occurs because of increased nuclear attraction.