Gasoline can stay stored in a gasoline container for up to 30 days before the gasoline starts to go bad.
You can add some fuel stabilizer to the gasoline to help it last a bit longer but you really should use the gasoline in the gas can up within a month or 2 months at most.
If you have gasoline in a gas can you should go ahead and use it up within 30 days and then get some fresh gasoline to use.
The old gasoline can cause your lawn mower, car etc to run rough or not run at all so you should not keep gasoline for longer than 30 days to prevent it from going too bad.
If I have gasoline left over in a gas can for my lawn mower I then add the rest to my car or truck and use it up and then get some fresh gasoline when i need it.
Gasoline also in a car or trucks fuel tank will go bad within a few months so you need to use that gasoline up as well.
You might think that you can fill the gasoline tank up and only drive the vehicle around for a little bit every few months and still have gasoline left.
But in reality the gasoline you filled up with will degrade making the gasoline unusable and then your car or truck will not run properly or at all.