If you're talking about ALL life, that will happen when the sun gets too hot for the continuance of life - which will happen well before it reaches the red giant stage. There may only be a billion or billion and a half years years left before that happens. By that time however, human kind will have advanced to a state we probably cannot even imagine so that will not be an issue for our species. We will most likely have long since abandoned Earth anyway.
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
Albert Einstein
Albert Einstein