What is the "shelf life" of guitar strings?
Modern guitar strings should be fine for at least 3-4 years if kept in good conditions. If using strings in traditional packaging, keep then in an air-tight container and away from cold and damp - high humidity is the enemy of guitar strings! If in any doubt about the condition of older guitar strings, check the top E string first, as rust or other corrosion tends to attack the thinnest plain strings before wound strings.
Modern sealed guitar string packaging such as D'Addario corrosion resistant sealed packs and new Ernie Ball foil packs are a big help in extending shelf life of guitar strings.
So if you see a bargain, go for it! That bulk pack of ten set sof strings or eBay "wholesale lot" could keep you playing for years...