The key is to keep it away from air. All current gas has ethanol in it and that attracts moisture which degrades it quickly and of course varnish deposits if evaporated. For aircraft the rule of thumb is 6 months for ethonol free auto gas and two years for 100LL. Both can go longer but with aircraft you shouldn't experiment.