In about 5 billion years the sun will turn into a red giant, which will then expand, and engulf the entire solar system, so that is probably when earth will finally give out. BUT in about 30 years or so we will go into a new ice age so we’ll all most likely be dead anyway! :)