If you are storing petrol for any period of time you need to add a fuel stabiliser which should make it good for over 2 years. Without a stabiliser they recommend no more than 3 months
Be careful how much petrol you store and in what type of container as there are (as usual) rules concerning it's storage. In metal containers it is a maximum container size of 10L and you can store a maximum of 20L, in plastic containers there is a maximum container size of 5L and you can store a total of 10L, and I think it also needs to be in approved containers.
You are able to store loads of diesel though, and it stays "good" for a lot longer