In the photoelectric effect, what determines the kinetic energy of the ejected electrons?

The frequency of the light and the "work function" of the metal surface that ejects the electrons