From Wikipedia:
The ionization energy (IE) is qualitatively defined as the amount of energy required to remove the most loosely bound electron of an isolated gaseous atom to form a cation.
and:
Work function is the energy required to strip an electron from a solid to just outside its surface.
Then why the first ionization energy is not identical to the work function? (there is roughly a factor of 1.5 between the two quantities)
(source)