Professor James Kasting, at Pennsylvania State University, calculates that the Earth's oceans will disappear in about one billion years' time, due to increased temperatures from a brightening Sun. However, well before the planet is left as an arid desert, the level of carbon dioxide in the atmosphere will be too low to support plant life, destroying the foundation of the food chains. Much of this water drifts up to the stratosphere and is lost into space. Eventually, all the oceans will leak out of the Earth's grasp.
Stars leave the main sequence when they stop burning hydrogen.
The Sun will then become a red giant, swamping and obliterating Mercury. Venus will lose its atmosphere and become a burnt-out planet. They are somewhat pessimistic and present a worst-case scenario, but they say a billion years. The earlier loss of carbon dioxide will occur because as the climate gets hotter and wetter, more rock is weathered by rain. This dissolves carbon dioxide and hides it away on the ocean floor as calcium carbonate.