The Einstein Photoelectric Theory
Einstein's explanation of the photoelectric effect was very simple. He assumed that the kinetic energy of the ejected electron was equal to the energy of the incident photon minus the energy required to remove the electron from the material, which is called the work function. Thus the photon hits a surface, gives nearly all its energy to an electron and the electron is ejected with that energy less whatever energy is required to get it out of the atom and away from the surface. The energy of a photon is given by E = hg = hc/l where g is the frequency of the photon, l is the wavelength, and c is the velocity of light. This applies not only to light but also to x rays and gamma rays. Thus the shorter the wavelength the more energetic the photon.
Many of the properties of light such as interference and diffraction can be explained most naturally by a wave theory while others, like the photoelectric effect, can only be explained by a particle theory. This peculiar fact is often referred to as wave-particle duality and can only be understood using quantum theory which must be used to explain what happens on an atomic scale and which provides a unified description of both processes.