Nothing lasts forever. The sun has a finite amount of nuclear fuel and will someday die. Earth will die with it.
It doesn't mean that life on Earth will freeze to death; the sun won't simply go out.
The evolution of stars is more complicated than that. As the sun consumes its nuclear fuel, it is gradually getting brighter. This is because the sun's core contracts, increasing the rate at which the remaining fuel is used.
The brightening of the sun will cause Earth to get warmer. More water will evaporate, and since water vapor is a greenhouse gas, this will eventually trigger runaway global warming. The oceans will boil away and Earth will become as hellishly hot as Venus.
The answer depends on theoretical models of the sun, and of Earth's atmosphere. A study published in 2013 estimated that it would happen in one point seven five to three point two five billion years from now.
That's a long time. The oldest human remains are only three hundred thousand years old. It leaves plenty of time for humans or their evolutionary descendants to settle other worlds. But what will happen to Earth?
The lifeless Earth will continue to orbit the sun. According to a study published in 2008, about seven to eight billion years from now, the sun will expand into a red giant star one hundred million miles in radius and engulf Earth (there are some scientists who do disagree that the Earth will be completely engulfed, but that doesn't mean the Earth will be spared from the consequences of the sun becoming a red giant).
Thank you to Jack T. O'Malley-James of Cornell University for reviewing this episode's script.
Sources And Further Reading:
- Emspak, Jesse. "What Will Happen to Earth When the Sun Dies?" LiveScience. April 13, 2016. Accessed October 11, 2017.
- Miller, Ron. "What the Death of the Sun Will Look Like." io9. April 9, 2013. Accessed October 10, 2017.
- Williams, Matt. "What Is the Lifecycle of the Sun?" Universe Today. September 24, 2016. Accessed October 10, 2017.