The electron affinity is defined as the energy change when 1 mole of gaseous negative ions is formed from 1 mole of gaseous atoms and 1 mole of electrons. (definition not needed).
X(g) + 1e X–(g)
The 1st electron affinity is usually exothermic (in some cases it is zero).
The electron affinity is a measure of the electron attracting ability of an atom. When the nuclear charge is high and the atomic radius is small the electron can approach closer to the atomic nucleus and feel a greater force if attraction. This translates into a larger energy release when the electron bonds to the atom.
Descending a group
The electron affinity decreases on descending a group. The number of energy shells increases and the electron is faced with more inter-electron repulsion as it approaches.
Notice that the 1st electron affinity of fluorine does not follow the group trend. This is thought to be because of inter-electron repusions in a full tightly packed second shell.
Across a period
The electron affinity increases across a period as the atomic radius gets smaller and the nuclear charge gets larger.