James Lovelock once estimated Earth’s biosphere would crash in about 100 million years when carbon dioxide levels dropped too low. James Kasting and Ken Caldeira updated the model to include a different photosynthetic cycle amongst land plants, pushing back Doomsday to about 900 million years in the Future. Those “900 million years” before Earth overheats is based on a certain model of Earth’s response to the Sun’s gradual rise in luminosity. That particular model assumes everything else will remain the same, but that’s unlikely. If the partial pressure of nitrogen declines, then the greenhouse effect from carbon dioxide will decline and the Earth could remain habitable to life for another 2.3 billion years. Alternatively because the greenhouse instability of the Earth is driven largely by the thermal response of the oceans, if Earth became a desert planet then it would remain habitable until the Sun reaches ~1.7 times its present output. Combined with a reduced atmospheric pressure, it means Earth might remain habitable until the end of the Sun’s Main Sequence in 5.5 billion years.
But this all assumes no technological intervention. Several scenarios are possible – a variably reflective shell engulfing the Earth is the simplest. Planet moving and Solar engineering are more dramatic possibilities. Given sufficient thrust a leisurely spiral of the Earth outwards from the Sun would compensate for the brightening, though the pace of travel would need to be rather rapid for a 6 billion trillion ton planet to escape the more dramatic stages of the Sun’s Red Giant Branch (RGB).
Once the Sun hits the Horizontal Branch/Helium Main Sequence, the habitable zone will be roughly where Jupiter will be – as the Sun’s mass loss during the RGB will cause all the orbits to expand by ~30%. The HB offers just 110 million years of stability before the Sun begins a series of dying spasms known as the Asymptotic Giant Branch. Not healthy for any of the planets. If the RGB’s mass-loss can be tweaked a bit, then the Sun won’t hit the HB at all and will slowly decline into being a helium white dwarf. Earth can remain in the white dwarf Sun’s habitable zone then for billions more years, more if it spirals inwards as it cools.