The sun has around 5 billion more years left according to NASA.
However this is just an estimate and the sun may have much longer left but currently 5 billion more years is the estimated time left for the sun.
After 5 billion years it's estimated that the sun will become a red giant star and then eventually shrink into a white dwarf.
The sun is currently in the main sequence stage of it's life and is fusing hydrogen into helium into it's core.
Once the sun runs out of hydrogen the sun will begin to die.
The sun will then swell into a red giant star, which will be much larger and also cooler that it currently is today.
The red giant sun will then engulf Mercury and Venus and even possibly Earth.
The sun will then eventually lose it's outer layers and then shrink into a white dwarf, which is still very hot but not as hot as the sun currently is now.
The sun so far is around halfway through it's life, which is estimated to be 9 to 10 billion years.
Although even before the sun does die, Earth will become inhabitable because the sun will then become too hot to support any life on Earth.