Your question is one of the most fundamental aspects of QM, that is, the relation between the classical EM wave of frequency ν and how it is built up by a herd of photons of E=hν.
It is not simple to follow if one does not have the mathematical background. Conceptually watching the build up of interference fringes from single photons in a two slit experiment might give you an intuition of how even though light is composed of individual elementary particles, photons, the classical wave pattern emerges when the ensemble becomes large.
What is the relation between electromagnetic wave and photon?
It is a very complicated mathematical theory, but it is beautifully describing how individual photons build up the classical EM wave.
Now based on that you could think that the energy of the classical EM wave is just the sum of the individual photons. Though, it is a little bit different.
Light is an electromagnetic wave, and think of the wave being made up of a large number of photons $N$ (even though technically it's a little more complicated than that). The wave has a frequency $f$. The energy of a single photon is $hf$, which might lead you to believe that the total energy is $E_{tot}=Nhf$, but in fact it's slightly different:
$E_{tot}=(N+1/2)hf$
The extra $(1/2)hf$ is sometimes called "zero-point energy", and it's interesting because it means that even when you have zero photons there is still some electromagnetic energy there.
How is light related to photons?