The work function, W, is the energy required to eject
an electron from the surface of a metal. The final energy of
the ejected electron is given by....
E = hf - W
... where the emitted photon has energy hf.
The ejection of photoelectrons from a metal surface is is
a bit like chuck-out time at the club.