In Real Life, gasoline is a very refined and volatile product. Creating usable gasoline (or any other petroleum-based fuel) requires extracting petroleum from the ground, and separating the various elements of it by carbon chain in an oil refinery. Gasoline is meant to be used soon after production, and has a usable shelf life of about 3-5 months. With fuel stabilizer, you can get a few more months out of it, but no matter what you add or how you store it, storing it for more than a year is out of the question. After that, it starts to break down and vaporize, becoming completely unusable (and also reducing to gunk that has to be cleaned out of the engine). But in today's modern world of nigh-ubiquitous motor vehicles, this is rarely a real problem.
In fiction, on the other hand, gasoline is just an eternally lasting fuel liquid that can sit anywhere for any period of time, and be as usable as the day it was refined. This is common in post-apocalyptic fiction, where everyone is still driving around in cars long after any refineries would stop producing. If such a post-apocalyptic world did occur in reality, we would be able to drive around for a few months, but afterwards, every gas-powered vehicle on the planet would be 100% useless.
This is basically a Sub-Trope of Ragnarök Proofing, in that something leftover from the old society still works despite it being impossible. Sometimes this is handwaved through Applied Phlebotinum, but often it just assumes that audiences think gasoline is eternal... probably because audiences learned it from them.
This trope doesn't only happen in post-apocalyptic fiction either. Sometimes people find a vehicle that goes for years or even decades unused, and they turn the key and it immediately turns on and works perfectly. Ignoring the fact that OTHER parts of the vehicle would need restoration, the gasoline still in the tank would be completely unusable and that transport is going nowhere.
Often overlaps with No Bikes in the Apocalypse, which is about a different piece of transportation technology not being used even though it can be.
- Five Graves to Cairo, set in 1942, has Erwin Rommel and the Afrika Corps attempting to reach and retrieve fuel dumps hidden in the deserts of Egypt by the Germans back in 1937, in peacetime.
- Another World War II thriller, Northern Pursuit, has German commandos infiltrating Canada in 1943 so they can assemble a plane hidden in the far north before the war. Naturally, the plane starts up and flies.
- Jurassic World: When Zach and Gray find the remains of the original Jurassic Park they also find the jeeps in the garage. The fuel inside is still usable despite it sitting there for over 20 years.
- Mad Max: Averted. Despite being the codifier for post-apocalyptic car battles, it's shown this is only possible because gasoline is still being actively produced somewhere. Much of the conflict in the movies revolves around different factions fighting to maintain control of the few remaining oil sources.
- Mad Max 2: The Road Warrior revolves around a conflict over an oil refinery between a tribe of people bound for Queensland and a wasteland gang led by Lord Humongous. It also opens on Max himself fighting gangsters on the highway and siphoning the gas out of their wrecked cars after he wins.
- In Mad Max: Fury Road, cars are able to run because there's a still-operational oil refinery held by one of the villains, the other two owning a lead mine (for bullets) and an aquifer (to grow food).
- Sleeper: Miles and Luna find a 200-year-old Volkswagen Beetle. It starts right up and they drive it for a considerable distance with no problems.
- Waterworld has interesting take on this trope, as the vehicles run on oil, not gasoline. Crude oil does have a longer shelf life, about ten years, but no vehicle in the world would use something so unevenly mixed as fuel (and a post-apocalyptic society couldn't build something that could). The setting is also implied to be hundreds of years, long past when those extra ten years would matter.
- Battlefield Earth: Jet fighters still work after a millennium without service, including apparently the fuel. Being less volatile than gasoline, jet fuel really does have a much longer shelf-life than gasoline, but even that's only a few decades.
- I Am Legend: Neville, the last human in the abandoned New York City, fuels his car by manually pumping out gasoline from abandoned gas stations. Like everything else in the city, these gas stations have been untouched for three years, with their last recorded price being 6 dollars a gallon!
- Averted in The Interview. The climax of the film involves the heroes breaking out in Kim Jong-un's old T-54 Soviet tank, which is shown in an earlier scene to be recently fueled because Jong-un takes it out for joyrides. (Like most Soviet or Russian tanks since the T-34, the T-54 has a diesel engine, but diesel's shelf life isn't much longer than that of gasoline.)
- Into the Forest has a downplayed example. There's never any concern about whether the sisters' gasoline will go bad, though this may simply be due to their ignorance. After at least a few months, it still powers the generator perfectly fine. After at least 15 months of storage, the gas is still volatile enough to be set ablaze with a spark, which might be possible.
- I, Robot: Detective Spooner keeps a 2004 MV Agusta F4-SPR 750 crotch rocket in a storage unit, which he and Dr. Calvin use to get around during the robot uprising (his unmarked car was totaled earlier in the film). He's established as a Fan of the Past and has apparently kept it maintained, but where he gets the fuel from is a question mark: Dr. Calvin is fearful of the bike since it's gas-fueled — she notes gasoline's tendency to explode — strongly implying that it's no longer commonly available in the film's 2035.
- Averted in Back to the Future Part III. After restoring the DeLorean which was buried in 1885, the 1955 Doc tells Marty "I put gas in the tank.", inferring that the car had its fluids drained before being buried. And this becomes a plot point when Marty travels to 1885 and accidentally tears the fuel line, forcing them to think about another way to have the DeLorean reach 88 mph.
- In Star Trek Beyond, Kirk finds a fictional Hilts PX70 dirt bike in the cargo bay of the crashed USS Franklin, and soon rides it to the rescue of his crew. The motorcycle is at least a hundred years old.
- Death Lands hand waves (partially) with the fact that one of the pieces of Lost Technology that is lying around is a mixture of gasoline that is superior to regular petrol, taking much longer to burn (a regular tankful goes around five times longer) and has a different chemical mixture (which probably includes some kind of preservation agent). However 1) the series happens a hundred-plus years After the End (which should make even the best petrol preservative be on its last legs realistically) and 2) oftentimes the cars or generators that appear use scavenged fuel from regular pumps.
- The Last Man on Earth takes place two years after a virus wipes out most life on Earth, yet the main characters are shown driving cars constantly. There is at least one mention of how long gasoline can last, but it never becomes a serious problem.
- The Last Train has a group of people who were cryogenically frozen during the Apocalypse wake up after forty years has passed, then go out and find a Mercedes Sprinter Van which starts and runs just fine pretty much on first turn of the key.
- Early during the second season of Lost, a few of the survivors find an old Volkswagen van that crashed and was abandoned deep in the island's jungle and is as decrepit as you would expect it to be. A whole episode is spent trying to make it roll (and it eventually does, even becoming a Chekhov's Gun for the season finale) but the main concern of the characters seems to be the battery, not the fact that it's been lying in a jungle for so many years (roughly since The '70s, when Benjanin Linus made it crash by killing his abusive father) that the gas must have long since gone bad. Probably another of the mysteries of the Island — just like the beer that was inside the van for the same amount of time yet is still fit to drink.
- The Twilight Zone (1959) episode "The Rip Van Winkle Caper". Four men enter suspended animation in a cave after a gold robbery and sleep for 100 years. When they wake up, their car starts up and can be driven with no problem.
- In The Last of Us, Bill gives Joel some siphoning equipment to get gasoline out of cars for his truck he just gave him. These cars should be too old to have any usable gasoline though.
- In The Walking Dead in Episode 5 of Season 2, Kenny suggests to Clementine and Molly to siphon gas from the abandoned vehicles even though they should be unusable. Episode 1 of Season 3 has Javier's party scavenging cars for gas years after that.
- Fallout 4 has cans of gasoline still usable as crafting materials for the "oil" category going on two centuries After the End. This is in spite of the Fallout setting being Post-Peak Oil and suffering a major energy crisis by the time of the Great War (and the fact that "oil" seems to be a lubricant rather than a fuel in many applications, when gasoline doesn't make much of a lubricant).
- In the Simpsons episode "The Principal and the Pauper", Armin Tamzarian (the former Principal Skinner) goes to the storage locker where he keeps all his stuff from his rebel days. His old motorcycle is in there, and despite being untouched for almost 3 decades, still works perfectly and gets Skinner to Capitol City.