Why is the energy of a photon ${\frac {hc}{\lambda }}$? The formulas for the kinetic and potential energies of an object can be derived from the definition of work.
However, I haven't been able to find a derivation of the fact that the energy of a photon is
$${\frac  {hc}{\lambda }}$$
Now, is this an experimental fact (which I doubt), or is there a derivation for this?
 A: In the early 1900s, the begin of quantum physics and quantum mechanics, two proposals were crucial to the result of the photon energy as $h\nu$: Planck's quantization of the black body radiation spectrum and Einstein's explanation  on the photoeletric effect. In the second (1905), Einstein proposes as a 'first principle', that light (or even electromagnetic radiation), (through the interpretation of the experiment results) should behave as small quanta, whose total energy is proportional to its frequency (this being a result of the fact that, in the photoelectric effect, there is a cut frequency, above which the effect is not observed). This constant of proportionality as being $h$ was tested several times along the last century and is a well-stablished experimental fact.
So, yes, it is an experimental fact tested uncountable times that emerges as a first principle proposal in 1905 (which can not be directly derived from other physics).
A: The expression for the energy of a photon is related to the energy of a simple harmonic oscillator. If we solve the Schrodinger equation for a simple harmonic oscillator we find it has energy levels:
$$ E_n = \left(n+\tfrac{1}{2}\right) h \nu $$
So the energy spacing between levels is $h\nu$. The relationship to the energy of the photon comes from quantum field theory. When we quantise the electromagnetic field we find the photons are described as excitations of field modes that behave as simple harmonic oscillators and the energy of the photon is equal to the spacing between the oscillator energy levels. This makes the photon energy equal to:
$$ E = h\nu $$
We find this relationship all over the place. For example the vibrational excitations of diatomic molecules are well described as a simple harmonic oscillator and the transitions between the vibrational energy levels happen by the emission or absorption of photons. Since the energy spacing between the levels is $h\nu$, and the photon frequency has to match the oscillator frequency, we again find the relationship $E=h\nu$.
A: This is an experimental fact. In the particle nature of electromagnetic radiation the energy is quantized. The smallest unit or entity has energy  $E=h\nu$. This fact is experimentally verified as it explains the photo electric effect (which is an experimentally observed effect). The frequency, $\nu$, can be written in terms of $\nu=\frac{c}{\lambda}$. Form this formula, the energy can further be expressed as $E=\frac{hc}{\lambda}$. Here $\lambda$ is the wavelength and $c$ is the speed of light.
A: It is an experimental fact based on fitting the experimental black body radiation curves. It is a basic experimental building block of quantum mechanics together with the photoelectric effect and the absorption and emission spectra of atoms.

Planck derived the formula which fitted the experimental curves for all temperatures, assuming that the energy of the electromagnetic wave was not continuous in frequency, but quantized and the fit gave the value to h.
The functional form 

The Planck constant:

First recognized in 1900 by Max Planck, it was conceived as the proportionality constant between the minimal increment of energy, E,  of a hypothetical electrically charged oscillator in a cavity that contained black body radiation, and the frequency, f, of its associated electromagnetic wave.

A: "The formulas for the kinetic and potential energies of an object can be derived from the definition of work." The definition of energy as the capacity to do work is, in my opinion, the best foundation on which to build an understanding of energy. But it is only a foundation… When we study thermodynamics and quantum mechanics (encountering, for example, the zero point energy of an oscillatory system) we have to interpret "capacity to do work" in such special ways that it ceases to be very useful. On the other hand, the fact that energy is conserved retains its usefulness. It is the justification, ultimately, for the photon energy formula, though insufficient by itself for deriving that formula. 
