Yes, gasoline actually has a rather short shelf life.
It begins to return to it’s unprocessed form. Often returns to a solid.
You can stay this process to a degree if you use a fuel stabilizer as @LuckyGuy has recommended.
If I was a character on The Walking Dead I would charge someone with collecting as much fuel stabilizer (and dehydrator/alcohol) as possible. I would consider this to be as vital a supply as anything.
As the series progresses the idea that one simply walks up to a car, hotwires it and takes off down the road becomes increasingly unrealistic.
In a way you can see it as the fuel turning back into the prehistoric creature it used to be.