Also, according Newton's law - an object with constant velocity and direction remains moving without losing energy unless some external force is exerted upon it.
When one is talking of electrons and photons, one is in the quantum mechanical regime, and also in the special relativity regime. Newton's laws apply to the macroscopic classical regime. Both the electron and the photon are elementary particles following quantum mechanical equations.
So, my questions is when a particular electron pass from an environment with lower resistance to an environment with higher resistance(flowing through conductive wire with given R1 and reaches a resistor R2 where R2 > R1 - a DC circuit)
Resistance is an emergent quality , it emerges from the underlying quantum mechanical behavior and describes the macroscopic behavior of circuits. Electrons in solids are described by the quantum mechanical model of the band theory of solids..
In a conductor the electrons belong in an energy band that ties them to the whole lattice, and the attraction of the electric field gives to each individual electron a drift velocity which will build up the current. In an insulator most electrons are tied in their locations in the lattice and very few are in the conduction band . More energy is needed to give a drift velocity to electrons.
some forces is being exerted upon its direction of movement but electromagnetic wave is not produced,
the concept of force at the quantum level is a change in momentum, a dp/dt . All such changes for an electron in an electric field will give electromagnetic radiation, i.e. a photon will carry off some momentum and energy. This energy will be in the infrared frequencies and will appear as heat when the current is high. For a conductor where the electrons are in the conduction band very little radiation is released because the dp/dt of the individual electrons is small.
Note that resistors heat up, that is photons in the infrared frequencies.
why is that, since in AC current produce such waves if electrons change their direction totally, so is this the necessary condition(180 degrees of change) for an electron to lose energy or is there something else?
No , it is not necessary to have a 180 degrees reversal. Any acceleration/deceleration will give off radiation. Applying a voltage to a circuit induces accelerations on the drifting electrons, including the statistical scatterings due to their motion. This radiation is in the infrared frequencies, appearing macroscopically as heat.
Now to address this:
A photon is emitted whenever an electron goes from higher energy level to lower energy level(goes from upper to lower valence shell), thus lowering its own internal energy and because of the difference between its current state of energy and its former one has to go somewhere(law of energy conservation) a photon is produced
For electrons in the conduction band the quantum mechanical energy differences in a conductor (where a large number of the electrons of the lattice are), are so small as to be considered a continuum. For electrons in insulators there will be scatterings of electrons moving in the conduction band with electrons bound strongly in the atoms of the lattice and those will take up energy and momentum in the form you are describing.