The Sun is powered by nuclear fusion: hydrogen `burns' to form helium, releasing energy
but the supply of hydrogen is not infinite.
~10% of the Sun's mass is available as fuel - 2 x 1032 kg, burned at 2 x 1022 / year.
At an age of ~10 billion years (slightly over twice its present age), the Sun will exhaust the fuel available in its core. Once that fuel is exhausted, and nuclear fusion ceases in the core (pure helium at this stage), gravitational forces are stronger than pressure, so the core collapses, becoming degenerate . That collapse generates more energy, leading to hydrogen-shell burning in the layers just beyond the old core; the higher energy generation creates internal pressure. Pressure overwhelms gravity, and over a period of a few hundred thousand years, the Sun evolves into a `red giant'
surface temperature drops to ~4000 degrees
radius increases to ~220 million km, or 1.5 astronomical units
luminosity increases by a factor of >23,000
As the Sun expands, it engulfs first the present orbit of Mercury, then Venus, then
Earth's orbit, finally reaching close to the orbit of Mars. However, as the Sun expands, it also
loses mass - and as it loses mass, the planets will move gradually outward on their orbit. Earth
will probably be close to the Martian orbit by the time theb Sun has reached its maximum
However, life on Earth will have become untenable well before this point: over the next 5 billion years, the Sun will gradually increase in brightness until it is twice as bright as at present. That change will be sufficient to raise temperatures on Earth to over 100C, evaporating the oceans and producing a runaway greenhouse effect.
Life could continue in the outer Solar System - on the larger Neptunian satellites, for example, although, even there, temperatures during the red giant phase would rise from the present -220 C to +400 C! (Pluto and Charon would evaporate, to become giant comets!).
Even the outer Solar System will become inhabitable in short order.
Red giants have lifetimes of less than 100 million years. The temperature in the red giant core increases to 100 million degrees
helium fusion starts (CNO cycle of reactions)
runaway reaction (known as the helium flash)
core expands (becomes non-degenerate), atmosphere contracts - helium-burning star
lifetime of ~100 million years, then runs out of fuel in helium core
the Sun enters the second red giant phase
We can track all of these evolutionary stages on the HR diagram.
During the final
stages of this second phase of evolution as a red giant, the
the outer atmosphere becomes unstable and starts to pulsate, leading to
variations in luminosity by factors exceeding 100 - and changes in temperatures on
the (few) surviving planets by factors of 3 to 5. (eg ~0 C to 1500 C at Neptune).
This phase terminates with the red giant expelling its outer envelope to form a `planetary nebula'; all that is left of the Sun is a `white dwarf', a remnant with approximately half the mass of the Sun, but a diameter comparable to that of the Earth.
Initially, the white dwarf has a temperature of 100,000 C, and a brightness ten times that of the present Sun, but, with no source of energy, it can only become cooler with time. Within a few thousand years, the white dwarf has cooled to ~10,000 C and reached a luminosity over 100 times fainter than the present Sun.
So if we can't remain in the Solar System forever, what options are there for relocation elsewhere in the Galaxy?