What determines how favorable (exothermic) the electron affinity of a certain element is?
The electron affinity (EA) of an atom (A) is defined as the minimal energy that is required to free an electron (e$^-$) from the associated anion (A$^-$)

$$
\text{EA: }\qquad\text{A}^-\text{(g)}\rightarrow \text{A(g)}+\text{e}^-,
$$
in other words, the electron affinity is the ionization energy of the associated anion. 

A large positive EA means that the anion A$^-$ is stable, while a negative EA indicates that the anion ${\text{A}^-}$ is unstable (such as He$^-$). Halogens have the largest electronegativity as the associated anion obtains a completely filled shell. 

In general, if an atom A obtains a full/half full shell/sub shell by addition of an additional electron, then A will have a large EA, while A will have a small EA if it already has a full/half full shell/sub shell. 

In addition there are some competing effects along a group in the periodic table. Consider the EA of the halogens for example:

Atom:      F       Cl      Br      I
EA /eV     3.40    3.61    3.36    3.06


(i) The smaller the principle quantum number $n$ of the highest sub shell, the larger is the attraction between the nucleus and electrons and the larger is EA. This would predict the trend to be EA(F) > EA(Cl) > EA(Br) > EA(I).

(ii) The smaller the principle quantum number $n$ of the highest sub shell, the larger is the electron repulsion the smaller is EA. The expected trend is EA(F) &lt; EA(Cl) &lt; EA(Br) &lt; EA(I).

As these effects are in competition with each other, there is a maximum in the observed trend for the halogens around chlorine. Where the maximum occurs, is unfortunately difficult to predict.