The International Union of Pure and Applied Chemistry (IUPAC) Gold
Book defines electron affinity as “Energy required to detach an
electron from the singly charged negative ion [...] The equivalent
more common definition is the energy released
Another definition that can be found: “Electron affinity is the energy released when an electron is added to the valence shell of a gas-phase atom.” Note the additional requirement here that the electron be added to the valence shell of the atom. It may make a difference.
First note that it is not self-evident that a stable negative ion exists. Atoms, even inert noble gasses, can be weakly bound together by Van der Waals/London forces. You might think that similarly, a distant electron could be weakly bound to an atom or molecule through the dipole strength it induces in the atom or molecule. The atom’s or molecule’s electron cloud would move a bit away from the distant electron, allowing the nucleus to exert a larger attractive force on the distant electron than the repulsive force by the electron cloud. Remember that according to the variational principle, the energy of the atom or molecule does not change due to small changes in wave function, while the dipole strength does. So the electron would be weakly bound.
It sounds logical, but there is a catch. A theoretical electron at rest at infinity would have an infinitely large wave function blob. If it moves slightly towards the attractive side of the dipole, it would become somewhat localized. The associated kinetic energy that the uncertainty principle requires, while small at large distances, still dwarfs the attractive force by the induced dipole which is still smaller at large distances. So the electron would not be bound. Note that if the atom or molecule itself already has an inherent dipole strength, then if you ballpark the kinetic energy, you find that for small dipole strength, the kinetic energy dominates and the electron will not be bound, while for larger dipole strength, the electron will move in towards the electron cloud with increasing binding energy, presumably until it hits the electron cloud.
In the case that there is no stable negative ion, the question is, what to make of the definitions of electron affinity above. If there is a requirement that the additional electron be placed in the valence shell, there would be energy needed to do so for an unstable ion. Then the electron affinity would be negative. If there is however no requirement to place the electron in the valence shell, you could make the negative value of the electron affinity arbitrarily small by placing the electron in a sufficiently highly-excited state. Then there would be no meaningful value of the electron affinity, except maybe zero.
Various reputed sources differ greatly about what to make of the
electron affinities if there is no stable negative ion. The CRC
Handbook of Chemistry and Physics lists noble gasses, metals with
filled s shells, and nitrogen all as not stable
rather
than giving a negative electron affinity for them. That seems to
agree with the IUPAC definition above, which does not require a
valence shell position. However, the Handbook does give a small
negative value for ytterbium. A 2001 professional review paper on
electron affinity mentioned that it would not discuss atoms with
negative electron affinities, seemingly implying that they do exist.
Quite a lot of web sources list specific negative electron affinity values for atoms and molecules. For example, both Wikipedia and HyperPhysics give specific negative electron affinity values for benzene. Though one web source based on Wikipedia (!) claims the opposite.
Also note that references, like Wikipedia and HyperPhysics, differ
over how the sign of electron affinity should be defined, making
things even more confusing. Wikipedia however agrees with the IUPAC
Gold Book on this point: if a stable ion exist, there is a positive
affinity. Which makes sense; if you want to specify a negative value
for a stable ion, you should not give it the name
affinity.
Wikipedia (July 2007) also claims: “All elements have a positive electron affinity, but older texts mistakenly report that some elements such as inert gases have negative [electron affinity], meaning they would repel electrons. This is not recognized by modern chemists.” However, this statement is very hard to believe in view of all the authoritative sources, like the CRC Handbook above, that explicitly claim that various elements do not form stable ions, and often give explicit negative values for the electron affinity of various elements. If the 2007 Handbook would after all these years still misstate the affinity of many elements, would not by now a lot of people have demanded their money back? It may be noted that Wikipedia lists Ytterbium as blank, and the various elements listed as not stable by the CRC handbook as stars, in other words, Wikipedia itself does not even list the positive values it claims.