Electrons excite to higher energy levels by taking energy from their surroundings through a process called absorption.
Electrons don't stay in the excited state for too long because this is an unstable state, they emit energy and return to ground level which is their stable state.
According to Neil Bohr, electrons revolve around the nucleus in stable orbits, they absorb energy and jump to higher energy levels and come back to the ground state by emitting energy.