There's bound to be a few of us who are curious how long the shelf life of gasoline is- whether you have a vehicle in storage, let your boat sit all winter, or if you have lawnmower gasoline that's been sitting a while.
There's not a magical sell by date for gasoline like there is for other products, but gasoline will slowly deteriorate over time and eventually be worthless. I'll go over a few ways to keep gasoline for years.
First, don't expect gasoline to last long in an open air container, such as a 5 gallon gasoline container. Unless you've sealed your red container, the air will slowly suck the life out of the gasoline. Like I said, there's no magical date, but after a few months, gasoline will deteriorate to the point you wouldn't want to use it in expensive engines. It may be suitable for mowing the lawn, but the octane rating may have changed.
The ideal way to keep gasoline most fresh over a long period of time is in an air tight container, such as in a newer vehicle. I have a late model vehicle that I drive only in the warmer months, and only when it's running ideally. Back in 2008, my transmission failed, and I had nearly a tank full of premium gasoline. As it turns out, I didn't start the car again until earlier this year. The premium gasoline had sit nearly 18 months in my gasoline tank. After the car had been fixed, I started it using the fuel in the tank. It started up after priming just fine (after letting a car sit for that amount of time, it becomes necessary to prime the oil system to lubricate the engine before attempting to start it). While 18 month old gasoline wasn't the best idea, it still ran my car. I then drove the car around town to heat cycle the engine and to attempt to burn off the older fuel. There were no issues with my car at all from using the old gasoline.
Also, watch out for water contamination in open air storage. This also is why gasoline doesn't last as long in this type of storage. Another factor is ethanol. Since ethanol is added to most gasoline available, the fact that ethanol is hydrophilic (is essentially sucks water out of the air), means that gasoline with ethanol may have a shorter life as it becomes contaminated with water and other moisture.
Boats may be a bit different. I recently talked to a gentleman who bought a boat with over 200 gallons of 3-year old gasoline in the tanks. He asked me what would be best to do. I advised him that since his boat engine is massive and expensive to repair, it would be best to drain the tank, saving the gasoline for use in lawn mowers, or perhaps test the use in his vehicle. He advised me later that he drained it from the boat and successfully consumed the gasoline in his vehicles with no side effects.
The lesson here seems to be that gasoline will hold fine over a few years- as long as it is properly stored. Open air storage (in a container that isn't sealed) significantly reduces life. Sealed storage (in a tank or vehicle) will mean little chemical changes over time.
I don't advise using older fuel in expensive engines unless testing, but gasoline can hold for months and years if properly stored. However, don't blame me if you go out and buy a 10,000 gallon underground tank and the gasoline goes bad before you think it will. Note that even a pinhole in any sealed tank will be enough to let air in, effectively reducing the life of the gasoline to the same as any open air container.
The best way to store gasoline is using containers or systems with tight caps. The type of container (metal, plastic, fiberglass) doesn't matter too much as long as you make sure the fiberglass container is deigned for use with alcohol based fuels (ethanol). Keep your container near full so that there's as little air in the container as possible. Also try to reduce or eliminate temperature swings where you're keeping the gasoline. Also, consider adding a product such as Stabil to your gasoline. Stabil offers aging protection of gasoline.