Answer:
4500 million years
Step-by-step explanation:
The Sun shines thanks to the thermonuclear conversion of hydrogen to helium inside. It is currently 4,500 million years old and has reservations for a similar period of time. When this fuel is exhausted in the central region, the heart of the Sun, constituted of helium and in an inert state, will contract and put more external fuel reserves within reach of the star, with which this mass of helium will grow over time . When that happens, the Sun will evolve into a giant star that will reach the orbit of Mars and, therefore, destroy the planet Earth.
As the helium heart mass increases so do the central density and temperature. When it reaches 100 million degrees, helium fuses thermonuclearly with itself and becomes a mixture of carbon and oxygen.
When the helium runs out in the center, the previous operation is reproduced approximately. The carbon / oxygen heart contracts and the helium and hydrogen of the surrounding layers are placed within the reach of thermonuclear combustion. The difference is that this double combustion is unstable and the density is so high that electrons can, alone, stabilize the heart of carbon and oxygen. The end result is that the outer layers, which originate a planetary nebula, are expelled, and the old thermonuclear reactor becomes visible, which becomes a white dwarf that slowly cools like the embers of a fire over billions of millions. of years.