> Earth has still millions of years of habitability
The lower bound is probably 600m to 1bn years. By then the sun's luminosity will have increased enough to eventually boil off the oceans. To get over this hump we'd need to sequester or condense atmospheric water vapor. That'd push our planetary survival time out to about 3bn years.