What's the difference between the work function and ionisation energy? In a particular textbook, the work function of a metal (in the context of the photoelectric effect) is defined as:

the minimum amount of energy necessary to remove a free electron from the surface of the metal

This sounds similar to ionisation energy, which is:

the amount of energy required to remove an electron from an atom or molecule in the gaseous state

These two energies are generally different. For instance, Copper has a work function of about 4.7eV but has a higher ionisation energy of about 746kJ mol-1 or 7.7eV.
I've sort of figured it's because the work function deals with free electrons whilst ionisation is done with a valence electron still bound within the atom. Is the difference due to the energy required to overcome the attraction of the positive nucleus?
 A: 
There is definitely a relationship between the work function and ionisation energy of the elements. See the above figure in which I plotted the work functions (blue) and ionisation energies (yellow) of the elements named in the table of the former answer.

If you plot them against each other, it shows an definite, though loose, relationship. I bet there really is a relation between the two, but I do not know exactly what it is and why it exists.
A: On first reading they do sound similiar, but they are entirely independent energies and concepts.
The work function of a metal refers to the minimum energy required  to release an electron from the surface of a metal by  a photon  of light. The work function will vary from metal to metal. You might have a read of these:  Compton Effect, this previous answer,  Work function 1 and this Wikipedia article Work Function 2.

The Ionization energy is the energy needed to release electrons from their bound states around atoms, it will vary with each particular atom, with one outer electron around that atom needing less energy to release it than a lower, more closely bound electron, which requires greater energy because of the greater electrostatic force holding it closer to the nucleus.
Also, to complicate things, you need to allow for the Shielding Effect of Inner Electrons


Periodic trends for ionization energy (IE) vs. proton number: note that within each of the seven periods the IE (colored circles) of an element begins at a minimum for the first column of the Periodic table (the alkali metals), and progresses to a maximum for the last column (the noble gases) which are indicated by vertical lines and labelled with a noble gas element symbol, and which also serve as lines dividing the 7 periods. Note that the maximum ionization energy for each row diminishes as one progresses from row 1 to row 7 in a given column, due to the increasing distance of the outer electron shell from the nucleus as inner shells are added.

A: Ionization energy is the energy required to remove the outermost shell electrons of an isolated atom of an element (gaseous phase). We define ionization energy when we have a single atom.
On the other hand, the work function is the energy required to remove the outermost shell electrons of a metal's surface atoms when they are involved in metallic bonding. The work function is the energy needed to take away METALLIC BONDED electrons. (It is obvious that all the outer shell electrons of a metal are involved in metallic bonding.)
The removal of the electrons from a sea of electrons needs less energy (generally) since they are attracted to many kernels at the same time, due to which the forces cancel out, resulting in free electrons.
Hence, the work function is generally lower than the ionization energy for a particular element.
