Gunpowder will keep virtually forever so long as its kept in a cool dry place.
What I was told the best storage conditions are arctic. Absolutely unchanging cold and bone dry. I saw a show and I think they were finding plant pieces from millions of years ago in the Arctic. They were freeze dried.
But, short of that, powder is going to degrade.
I don't know much about the degredation of it. From what I hear there is never a real difference in performance with age
There are literally tens of thousands, perhaps more, people working in an specialty called “insensitive munitions”. These are the experts and they cull out hundreds of thousands of tones of old small arms ammunition each year because the stuff is beyond its shelf life. Smokeless propellants degrade. When it degrades the quality of the ammunition gets worse, gets dangerous to the user and in large enough quantities, spontaneously catches fire. At least one ammunition dump explodes each month in the world. Just google it.
Heat is the absolute worst enemy to smokeless propellants but chemicals, water, anything ionic, will accelerate the decomposition of nitrocellulose based powders. Gunpowder as we know is deteriorating the day it leaves the factory. Gunpowder is a high energy molecule that is breaking down to a low energy molecule.
The experts have a number of tests to determine whether gunpowder should be scrapped or not. None of us here have the ability to test stabilizer content in our powder so the best we can do is apply rules of thumb and look for gross indications of powder deterioration.
The rule of thumb for powder kept in 70ish temperature conditions is a 20 year safe shelf life for double based and 45 year for single based.
If powder smells bitter, looks red, it is well past its shelf life.
Old powder outgases NOx. If you smell a bitter smell it is NOx, and the powder is way past unsafe.
Powders that have no smell may be past a safe shelf life. These cases were loaded a year ago with my last batch of surplus IMR 4895. Upon firing I had an unusual number of cases crack at the case neck and I even got case head separations. This is an indication that the powder is outgassing NOx . One of the byproducts of NOx is nitric acid gas, that will attack brass. The powder shot excellent groups during testing, it does not smell, but now I am really pondering what to do with it. I hate losing 16 lbs of powder, but I know it is not to be trusted. I will probably end up pouring it out.