If electrons are unstable in a higher energy state, why do they attain those excited states? Electrons can absorb energy (discrete) to jump from lower energy states to higher. Once they reach higher energy states they become unstable and jump to their ground state by emitting photon (of specific energy). 
But what is the reason for attaining the higher and unstable energy states by the electrons? Are there any specific factors for this event to take place? And can someone explain this stuff clearly?
 A: Electrons are stable elementary particles. They do not decay.
A quantum mechanical solution for the potential between an electron and a proton, forming a hydrogen atom,for example,  gives energy levels which can be occupied by an electron. These energy levels have a width which is due to the probability of an electron transition from a higher energy level to a lower one.
It is the whole atom that transitions from one state to a lower energy state

This is the Bohr model solution for the hydrogen atom. The orbits in the quantum mechanical solution are orbitals, probability loci.

So if an electron is captured at one of the high n (energy )levels, it will emit during capture the appropriate energy photon and then there can be a cascade of transitions of photons ending up in the ground state. This will give the emission spectrum of the hydrogen atom.
Once the hydrogen atom has the electron in the ground state it will remain there unless an interaction with a photon happens.

But what is the reason for attaining the higher and unstable energy states by the electrons? Are there any specific factors for this event to take place?  

The atom  can only be excited by a photon providing  the appropriate energy between energy levels. That is the appropriate factor. 
The absorption and emission spectra show the widths of the photon energies that can excite the atom.

A: For the same reason any physical system has more energy than its ground state: because some thing or other gave it the extra energy. It's hard to give a more concrete answer on something this general, though, because how the energy gets there will vary wildly depending on the situation.
Some common reasons:


*

*The atom absorbs a photon of the relevant energy.

*The atom is kicked into that excited state by a collision, say, with an electron in a discharge tube.

*The atom is in a hot gas with temperature $T\gtrsim\Delta E/k_\mathrm B$, and it regularly acquires energy $\Delta E$ in collisions with other atoms in the gas.


There's plenty of other ways to arrange this, but either way you need an environment which is energetic enough, or a mechanism that is directly pumping energy into a specific transition.
