Earth will be habitable for at least another 1.75 billion years but after that our planet's seas will evaporate and any life remaining will die.
Astrobiologists at the University of East Anglia have worked out how long Earth has to live by analysing our distance from the sun and temperatures at which it is possible for planets to have water.
They found that the Earth will get too hot to hold water between 1.75bn and 3.25bn years in the future.
Andrew Rushby, research leader, said: "After this point, Earth will be in the 'hot zone' of the sun, with temperatures so high that the seas would evaporate. We would see a catastrophic and terminal extinction event for all life.
"Of course conditions for humans and other complex life will become impossible much sooner - and this is being accelerated by anthropogenic [human influence on nature] climate change.
"Humans would be in trouble with even a small increase in temperature, and near the end only microbes in niche environments would be able to endure the heat."
Rushby said that humankind has been around for only 200,000 years, while insects evolved 400 million years ago. He said this was an important fact as it showed how long intelligent life takes to evolve. The potential for the evolution of complex life needs a longer period of habitable conditions.
"It allows us to investigate the potential for other planets to host life, and understand the stage that life may be at elsewhere in the galaxy," he said.
"Much of evolution is down to luck, so this isn't concrete, but we know that complex, intelligent species like humans could not emerge after only a few million years because it took us 75% of the entire habitable lifetime of this planet to evolve. We think it will probably be a similar story elsewhere."
The researchers used their model to look at planetary habitability over time. They found several planets that have longer lifetimes than Earth: "No true Earth analogue planet has been detected. But it is possible that there will be a habitable, Earth-like planet within 10 light-years, which is very close in astronomical terms. However, reaching it would take hundreds of thousands of years with our technology.
"If we ever needed to move to another planet, Mars is probably our best bet. It's very close and will remain in the habitable zone until the end of the sun's lifetime - six billion years from now."