But, then the electron would lose energy and fall into the nucleus. To resolve this problem, Planck made a wild assumption that energy, at the sub-atomic level, can only be transfered in small units, called quanta. The word quantum derives from quantity and refers to a small packet of action or process, the smallest unit of either that can be associated with a single event in the microscopic world. Changes of energy, such as the transition of an electron from one orbit to another around the nucleus of an atom, is done in discrete quanta. Quanta are not divisible and the term quantum leap refers to the abrupt movement from one discrete energy level to another, with no smooth transition.
Quantization limits the energy to be transfered to photons and resolves the UV catastrophe problem.
There is no current flow for red light because the packets of energy carried by each individual red photons are too weak to knock the electrons off the atoms no matter how many red photons you beamed onto the cathode. But the individual UV photons were each strong enough to release the electron and cause a current flow. The response to this question arrived from the Ph.D. thesis of Louis de Broglie in 1923. There are some slight problems, such as the wave packet doesn't really stop at a finite distance from its peak, it also goes on for every and every. So energy is also connected to the wave property of matter.