There is a phenomenon called the photoelectric effect wherein light incident upon certain metals can cause currents to flow (this is the basis of photocells). What happens is that the light causes electrons to be knocked loose from the surface. However certain experimental data was difficult to explain using the standard wave picture of light:
Here is an analogy. Suppose we have a soda machine that only accepts dollar bills. Do you have enough money for a soda? Suppose you have a penny. Not enough. A friend starts giving you more pennies. But no matter how many pennies they give you, you will never get a soda because you need a whole dollar in one bill to get one soda to be ejected from the machine. (In this analogy the soda can is the electron, and the coins represent photons of discrete values, i.e., energies.)
In the photoelectric effect the electron needs the threshold energy in the form of one photon to be ejected. The electron doesn't store up lower energy photons until the threshold is reached. It needs that energy all in one go. Thus, Einstein reasoned, the properties of the photoelectric effect are consistent with light coming in discrete packets, called photons. The subsequent history of twentieth century physics amply confirms this picture.