The electron affinity values for the halogens show the following trends
The electron affinity of an atom or molecule is defined as the amount of energy released or spent when an electron is added to a neutral atom or molecule in the gaseous state to form a negative ion.
Electron affinity of an elements depends on certain factor like
Number of protons and size of atom: Halogens are smaller atom compared to other elements in same horizontal lines in the modern Periodic table.
As fluorine sits atop chlorine in the periodic table, most people expect it to have the highest electron affinity, but this is not the case. Fluorine is a small atom with a small amount of space available in its 2p orbital. Because of this, any new electron trying to attach to fluorine experiences lower electron affinity from the electrons already living in the element's 2p orbital. Since chlorine's outermost orbital is a 3p orbital, there is more space, and the electrons in this orbital are inclined to share this space with an extra electron. Therefore, chlorine has a higher electron affinity than fluorine, and this orbital structure causes it to have the highest electron affinity of all of the elements.