You See, I'm Dying

"Tekeny Ghemor: Major, it's a good plan. But I can't help you.

Major Kira: Why!?

Tekeny Ghemor: I have Yarim Fel Syndrome. It's terminal, Nerys. I'm dying."

- Star Trek: Deep Space Nine, "Ties of Blood and Water"

It's the revelation, usually at the beginning of the movie or episode, where a character reveals the fact that he won't be around for much longer. You see, he's dying. Even better is when it's the lead-in to the opening credits, ending the teaser of an episode.

Anime and Manga

 * All the cyborgs in Gunslinger Girl, but Triela makes specific mention of it.
 * Fullmetal Alchemist: Izumi in the first series.

Comic Books

 * An interesting variation: In an early X-Men comic, after the day is saved and the villain defeated, Professor Xavier collapses. Dying, he reveals to his students that he has known that he was dying for some time and that this was how he wished to die: a hero. He was telling the truth -

Films -- Live-Action

 * Breaking the Code: A moving scene has a colleague of Alan Turing reprimanding him for his eccentricity and overt homosexuality, which is discomforting his co-workers. He points out that if he was dying of cancer he might experience the desire to break down in tears, but he seeks to spare everyone embarrassment due to his love for them. Turing asks quietly if he really is dying; his friend just changes the subject.

Literature

 * In the end of Foundation and Earth, reveals that's what's happening to him.

Live Action TV

 * Star Trek: Deep Space Nine: In "Ties of Blood and Water", a visiting Cardassian dissident, Tekeny Ghemor, comes aboard to visit Major Kira Nerys. After she tries to enlist his help in leading the movement against the Cardassian-Dominion joint alliance, he suddenly reveals that he has an as-yet-unheard-of ailment and that, you see, he's dying.
 * Star Trek: The Next Generation. Evil Twin android Lore is about to walk out on his creator Dr Soong when the latter reveals that he is dying -- as Lore, for all his faults, does have emotions, this makes him stop.
 * In the Buffy the Vampire Slayer episode, "Lie to Me", Ford gives this speech to Buffy as his reason for wanting to become a vampire. The fact that, in doing so, he'll get Buffy, Buffy's friends, and a bunch of Idiot Bystanders killed is secondary to the fact that he doesn't want to die.
 * Casualty: This happened with Nick Jordan due to a brain tumor. He got healthier and has at least five years left.
 * The 2007 Doctor Who Christmas Special, "Voyage of the Damned". The Captain of the Starship Titanic has a terminal disease, and helps set up the villain's plan (killing himself in the process) in exchange for the knowledge that his family will be provided for.
 * Breaking Bad: Walter White dying of terminal cancer is the main premise of the series.
 * Happens on Golden Girls with Blanche's sister.
 * Battlestar Galactica Reimagined, with President Roslin.
 * In an episode of Las Vegas, a childhood friend of Delinda Deline shows up, only to inform her that he's dying of cancer, and is going down a bucket list. This list includes sleeping with her.
 * One episode of Babylon 5 opened with an old political enemy of G'Kar's (That he had apparently ruined some time before) sending him a message informing him that not only is he dying, by the time the message arrives he will already be dead. G'Kar doesn't appear to mind this, until the recording goes on to mention that as his last act, the man had spent a significant part of his remaining fortune to put a hit on him.

Video Games

 * Thane Krios from Mass Effect 2, who joins the suicide mission precisely because he doesn't have much time yet, and he wants to make the galaxy a better place before he dies.
 * of Persona 3 also plays with this trope a bit. He never explicitly tells anyone that he is dying; Akihiko expresses concerns about the side effects of the medication he's taking and an attentive player will notice that his critical failure animation in combat is a coughing fit, but it's not until almost the last minute that Takaya reveals it for him, and even then it's more implied than directly stated.

Visual Novels

 * Heiress II: This is essentially the entire premise of the visual novel. The main character is purchased in a charity date auction by a young woman who explains that she was poisoned by a harmful by-product in a bottle of improperly prepared hand lotion (It sounds a lot less goofy when explained in-game) and asks him to keep her company for her last few hours.

Web Original

 * The London Librarian and her mother are both in remission from cancer...and having the time of their lives messing with a Humanoid Abomination. They're planning to die of natural causes just to tick him off even further.

Western Animation

 * Mozenrath from the Aladdin series explains this to Xerxes at the start of Two to Tangle.