Online Astronomy eText: Stellar Evolution
The Fate of the Earth Link for sharing this page on Facebook
(summary of brief lecture notes; to be considerably enlarged later on)
(also see The Late Main Sequence Life of the Sun and Outline of Stellar Death)
Summary of the Sun's Future
     As noted in The Late Main Sequence Life of the Sun, the conversion of hydrogen to helium in the core of the Sun is causing it to become larger and brighter. While there is still hydrogen in the core, this change in properties is relatively slow (although it has been going on long enough that most astronomers believe that conditions on Earth will extinguish all life between 1/2 and 2 billion years from now). The Sun has probably increased in brightness by only 50% in the nearly five billion years since it was formed. But as the Sun ages the process will become faster, and when the hydrogen in the core is exhausted the Sun will rapidly swell to become a red giant (a process taking only a few millions of years) considerably larger than the current orbit of the Earth, remain as a red giant for a few tens of millions of years, then eject a substantial portion of its outer layers and collapse to become a white dwarf. (All these stages will be discussed in more detail at a later date.)

The Effect of Mass Loss on Planetary Orbits
     If the Earth remained in its present orbit these events would doom it to being swallowed by the Sun, which would vaporize it within a century or so; and for Mercury and Venus that is certainly what will happen. But for the Earth and the outer planets a different fate awaits, as the Sun is certain to lose at least some mass while it grows to red giant status, more mass while it is a red giant, and still more in the ejection of a planetary nebula prior to its collapse to a white dwarf. And with its lower mass comes a lower gravity, so it will not be able to "hold onto" the planets as well as it can with its present mass and gravity.
     Mathematically inclined individuals may refer to The Effect of Stellar Mass Loss on Planetary Orbits for a discussion of how this process works. To summarize the results, presuming negligible friction between the Sun's lost gas and the planets, the change of mass that the Sun experiences will produce a change in the size of the (remaining) planetary orbits as shown here:

anew / aoriginal = (Mnew / Moriginal) / (2 Mnew / Moriginal - 1)

where a is the (new or original) size of an orbit and M is the (new or original) mass of the Sun. For small changes in the mass of the Sun the orbital size grows by about the same percentage as the change in the mass, but as the mass loss approaches 50% the orbital size grows more rapidly, and when the mass loss reaches 50% the planets escape into interstellar space (the same thing happens in binary star systems when the mass loss exceeds 50% of the total mass of the system):

Mass lossMnew / Moriginalanew / aoriginal

(Note to author: Among other topics, be sure to cover:)
The heating of the planets by the Red-Giant Sun (namely 20 to 40 times current temperatures)
Vaporization of small icy bodies during that stage
The lack of heating of the planets by the White-Dwarf Sun (namely nearly absolute zero)