ICs as such dont have a shelf life, like milk or so. They do age on the shelf, though, but generally not as fast as when in use. What happens is you have a rising probability of ICs being dead when unpackaged, or dying earlier when used.
Oxidation, radiation (both natural and man-made), and chemical degradation of the dielectric, and probably several other aspects, degrade the ICs over time.
The effect of these influences largely depends on the manufacturing process and the quality of the IC. A well made IC may be less prone to oxidation, for instance. Older ICs (aka larger structures) have more material to be eaten away. Some ICs have dielectrics than can be more prone to aging. Modern ICs seem to be built with thinner, but more robust dielectrics.
All told, the ageing through technology means more. I do have perfectly working 74ls00 that is over 30 years old in an apparatus that is mostly turned off. Would I use it to build something today? Probably not.
But then again, from a museum perspective, it is quite important to know how to preserve ICs: Dry with a desiccant, in a metal container which is not radioactive seems to be the best bet.
See Aging of Integrated Circuits