In creative works, one of the common rules is a character who either has or is diagnosed early on with a terminal condition will be dead at the end (i.e., Chekhov’s Cough). However, this rule is not a constant since there are times a doomed character will get a temporary stay of execution from his or her creator. This thread is about those exceptions.
The first example that comes my mind is the lesser-known Burt Reynolds movie, The End. Burt’s character, a crooked real estate agent, is diagnosed with an unspecified incurable illness in the opening scene. He’s still running around when the credits roll.
A similar plot is found in the Adam Sandler movie Funny People, though according to the Wikipedia article the character is told at one point that his fatal illness is in remission. The character was told early on that he had a terminal condition, so the movie may (or may not) fit your criteria.
2005’s Constantine also features a character given a terminal diagnosis who is alive at the end (though through supernatural intervention in that case).
In the TV series House, the titular character’s friend Wilson was diagnosed with terminal brain cancer at the beginning of the last season. The series ends with the two of them on motorcycles, about to hit the open road and ride free for as long as they can.
As the TV series St. Elsewhere began, Dr. Daniel Auschlander (Norman Lloyd) had been diagnosed with metastatic liver cancer, with a very poor prognosis. Over the course of the series, his cancer went into remission, and the character survived through all six seasons of the series.
In the well-known series finale, Auschlander dies – but from a stroke, not cancer. However, when the final scene of the episode suggests that all of the events seen in the series have been in the imagination of Tommy Westphall (the autistic son of Dr. Donald Westphall), Auschlander is shown to be alive, and is apparently Tommy’s grandfather.
In some movies the effort to save someone with a terminal condition is the whole point of the plot, like Lorenzo’s Oil. These may not be in the spirit of the OP.
Lorenzo, a boy with an untreatable fatal genetic disorder, is predicted to die within two years, but his parents figure out a treatment that saves his life.
There was a series of mystery short stories about a detective who got a terminal diagnosis in the first one and continued to solve crimes. I don’t recall the name or author.
Way back in the 1960s there was a series called Run for Your Life, where a terminally ill man decides to do everything he hasn’t done yet, going from place to place, touching the lives of everyone he encounters.
Actually, it was The Fugitive, except instead of Lt. Gerard chasing the hero, it’s the Grim Reaper.
There was a movie with Queen Latifah getting a terminal (mis)diagnosis and choosing to blow all here carefully saved money on a fantastic trip. Only she’s not dying.
In the remake of D.O.A., Dennis Quaid’s character - poisoned at the beginning of the film - is still alive at the end but this probably doesn’t count because he’s still going to die later from the poison. In the original, however, the main character dies before the end of the film.
Joe vs the Volcano - the terminal illness turns out to be fake, to the surprise of no one but Joe.
Creed features an enfeebled, cancer-stricken Rocky Balboa, who is declining treatment. As you would expect only in this thread, Rocky does not die. The film ends with Rocky doing a blistering training run up the “Rocky steps” in front of the Philadelphia Museum of Art. Okay, it’s more of a hobble. And Rocky’s getting help from Creed. But he’s heading up those steps at least one more time. Sequel possibilities in which Rocky recovers the heavyweight championship are not yet fully eliminated.