Light has a dual character. In certain physical experiments it acts like an electromagnetic wave, while in other experiments it acts like being composed of particles that are named photons.
The electromagnetic character of the light has been discovered when James Clerk Maxwell has calculated for the first time the speed of electromagnetic waves using his famous equations. Since the speed of light observed experimentally and the computed electromagnetic waves speed were the same it has been deduced that light must be an electromagnetic wave in its nature. The corpuscular nature of light was first postulated when the external electromagnetic effect was discovered, because the laws that governed this effect were consistent with light being composed of tiny particles named photons.
As said above there are certain experiments when light behaves like an electromagnetic wave. A good example is the reflexion and refraction of waves from/by a a surface. Another examples are the polarization of light after reflexion on a mirror at a certain angle, and the interference of light. There are also experiments when light behaves like a particle. For example the spectral emission characteristics of a black body and the above photoelectric effect can be explained only is light is considered as being corpuscular.
Observation: despite of what is believed, the first scientist who imagined the light as being composed of tiny particles was in fact Newton.