Why does energy come in the form of packets? Photons are the packets of energy released by continuous oscillation of charges.

But I have some questions about this.
Since the electrons oscillate regularly while transitioning between orbitals then why is the energy released in the form of packets and not continuously in the form of waves  ? What causes this discontinuity in released energy by electrons ?
A physical reasoning will be more appreciated than a mathematical one.
Note : By the word continuous , I am referring to the fact that two consecutive photons have time gap between their emissions while waves are just continuously produced with no gaps at all.
 A: The straight answer is that nobody knows why. We only know how.
By how I mean that we have accurate methods to predict experimental numbers. We can solve wave equations with advanced methods, as in quantum chemistry, and add on QED radiative corrections, for example.
So we know how but not why wave equations account, and very accurately so, for the behaviour of discrete particles.
I think it is important that we lay our cards on the table and that students are not trained to think that we understand QM fully.
A: Photons are quantum mechanical elementary particles in the very successful quantum field  theory standard model. If you look at the table, they are on par with electrons, and  individual photons are point particles, not waves in any space. What waves is the mathematical complex value wavefunction $Ψ$, whose only measurable prediction is the probability of finding a photon in (x,y,z,t) in space, equal to the real number  $Ψ^*Ψ$ .
What you had drawn (in a previous version) was  a description of a free  photon as a wavepacket , in quantum field theory , and it is a probability wave packet, not a space and time wave wavepacket.

Since they oscillate regularly or continuously then why is the energy released in the form of packets ?

The premise is wrong. Individual photons do not oscillate, see this experiment with single photons at a time. It is the probability of measuring it that oscillates.

What causes this discontinuity in released energy ??

the fact that is a single particle that is carrying it.

Can we calculate the time gap between each of these photons ( which should exist when we say them as packets ), even if it is too small ??

Everything in quantum mechanics that can be calculated is probabilistic. There will be a calculable  probability , depending on the source, whether an atom, or a decelerating electron or other charged particle.
As the energy of a photon is $hν$  where $ν$ is the frequency of the classical wave many thousands of photons build up (see link of single photons above) and h is a very small number, ordinary electromagnetic waves, light, emerge from  zillions of photons in a way calculable with quantum electrodynamics.

Since the electrons oscillate regularly then why is the energy released in the form of packets and not continuously in the form of waves ? What causes this discontinuity in released energy by electrons ?

Free electrons, of fixed momentum,  do not oscillate. Thep probability  of finding them at (x,y,z,t), connected with the wavefunction, has sinusoidal behavior.
Electrons  decelerated  in some field, do radiate  photons, i.e. elementary particles , which by their existence take energy away.
Electrons bound in the atoms do not oscillate regularly. They are quantum mechanically bound in orbitals at specific energy levels with specific quantum numbers. See the simple orbitals for electrons in a hydrogen .
Actually the discontinuity, the spectra of the atoms, is one of the basic reasons quantum mechanics was invented. See this answer of mine.
A: Short answer: Emission of photons doesn't mean their frequency will be discontinuous rather their energy will be discretized, given by $E=\hbar \omega$ Planck relation. Photons by definition is an object having energy given by its frequency, hence they're bound to be discrete.
Long one: Fundamentally photons (massless spin-$1$ particle) are given by quantum field $$A_{\mu}(x)=\int \frac{d^3p}{(2\pi)^3}\frac{1}{\sqrt{2\omega_p}}\sum_{j=1}^2(\epsilon_{\mu}^{i}(p)a_{p,i}e^{-ipx}+\epsilon_{\mu}^{i*}(p)a_{p,i}^{\dagger}e^{ipx})$$
So whenever we have a photon somewhere we know for sure it has been created by the action of $a^{\dagger}$ on the vacuum $ |0\rangle$ so it is bound to be discrete however it is produced whether by action of $e^-,e^+,p^+$ or any other feasible process, strong statement.
Your example of photon production by the acceleration$*$ of $e^-$ appears in lot of phenomenon Bremsstrahlung, Cyclotron radiation, Synchrotron radiation. At the risk of oversimplification, all of these processes can be represented by


So you can see a photon is bound to be discrete because of our definition. In classical Electrodynamics, due to coarse-graining, we take photons to be a continuum or EM waves. They are getting bombarded at such a large number per unit time that we don't need to take the discreteness into consideration.
As for the discreteness of photons during the transition of electrons between orbits or band structure. They can only come into existence if the electrons do the required energy transition, ex. LED, hydrogen spectrum of bound electron since only have discrete energy to produce we are bound to get the discrete frequency.
But other times thermal emission/black body radiation the frequency of emitted photon is a continuum so only energy is discretized here.
Takeaway: In the first case both energy and frequency are discretized while in the second case only energy is discretized so if you put a counter which records photon energy and frequency you're bound to get clicks in integers unless your intensity is very high (no need of QM) because of our definition of photon also for the former not only will the energy of individual photons be related to frequency but the frequency will come in steps while in latter photons will have their characteristic energy but the frequency will be in continum.
$*$ acceleration is not defined in QM.
A: You write:

Since the electrons oscillate regularly while transitioning between orbitals then why is the energy released in the form of packets and not continuously in the form of waves?

I think this is precisely the reason which led to quantum mechanics. If the electrons would emit radiation while heading for an orbital with less energy, you are viewing the process in a classical electromagnetic way. The electron would spiral down towards the nucleus of the atom while continuously emitting electromagnetic waves(Bremmstrahlung with increasing frequency) until it would smash into it.
Obviously, this is not the case. Atoms are stable configurations. The electrons in an atom can only reside in the orbitals of the atom and no (eigen)states in between (or in a normalized linear combination of them).
When an electron falls back to an orbital with lower energy, this doesn't proceed by the electron spiraling down to the lower energy level while emitting radiation. As said, what would the electron stop from falling further? It happens in an almost instantaneous event.
For example, the electron in a high energy orbital (in the associated eigen-orbital). It won't descend to a lower orbital in a continuous way while emitting continuous bremsstrahlung (that's increasing in frequency) but, for example, by emitting one, two, or more photons, which together have the energy difference between the two orbitals.
The photons are emitted as wavepackets with a range of frequencies, so they don't have a well-defined energy. But neither have the orbitals, as they are occupying a finite piece of space, so due to Heisenberg's uncertainty relations, there is an uncertainty in the electron's momentum too (and thus energy). So we are talking about mean values.
The bottom line: Electrons don't spiral down continuously towards the nucleus because in that case, atoms could not exist. And the world would look very different! Quantum mechanics came to the rescue.
Maybe you like this question and answers to it.
