What you are talking about is transition of electrons between the different energy levels in an atom/molecule. One of the necessary conditions for that to happen is that the energy of the photon should match the energy difference between the energy levels.
However, if the photon possesses enough energy for the electron to overcome the attractive forces of the metal and escape the lattice, it will absorb the energy and escape the metal. If the energy of the photon is just enough for the electron to overcome the attractive forces, it will escape without any kinetic energy. Frequency of light at which this happens is called the threshold frequency. For frequencies higher than the threshold frequency, the electron escapes with a kinetic energy equal to the difference between the energy of the photon and the energy required for the electron to overcome the attractive forces.