What determines the electronegativity of an element?
There are various slightly different electronegativity scales.  The two most common are the Pauling scale and the Mulliken scale.  Of the two the Mulliken is the simplest.

The Mulliken scale is based on two quantities, both measurable.  One is the ionization energy $(E_i)$, the energy required to remove an electron from a neutral atom.  The other term is the electron affinity $(E_a)$.  That is the energy released when the neutral atom gains an electron.

The Mulliken electronegativity $\chi$ is then given by

$$
\chi = (E_a + E_i)/2
$$

It is that simple!

For more details and explanation see

http://en.wikipedia.org/wiki/Electronegativity