Electronics Shelf Life
Do parts and PCBs have a shelf life? Well, yes and no. I have some 7400 series logic chips in DIP form  that I bought back in 1980. Every now and then, I pull one out and put it into a proto board to test some circuit idea I've got. They still work thirty years later. I haven't taken any special care in storage either. Some are stuck into anti-static foam. Some are not. All are sitting in a mini-parts bin without any moisture protection. I guess they do get a little shielding from light, but basically, they're just hanging out. They've been, at various times, in the attic, in the basement, in the garage or in the house.
That may seem like good evidence refuting a shelf like for parts. And today's parts are even more robustly  designed to start with. Still though, if I use any of those parts, it's generally in a proto board or a socket. Sometimes I have to straighten the leads a bit. A lot of things don't matter so much at low temperatures, low speeds, low volumes and large geometries.
It's different when you have fine pitch parts being picked up and placed by a robot and then run through a 10 stage reflow oven. Oxidation that doesn't matter for a socketed prototype can interfere with the solder adhesion. Bent pins or missing BGA balls can prevent the part from fitting. Moisture absorbed over time can make the chip act like a pop corn kernel when in the reflow oven.
That's not to say that you can't use old parts for a prototype these days. Just give them a good inspection before sending them off for assembly. And, if they're moisture sensitive parts or have been stored in high-humidity areas, consider having your assembly house bake them before assembly. The same goes for raw PCBs too. Overly moist PCBs can delaminate during reflow. Some PCB finishes such as immersion sliver and OSP can tarnish  or degrade  over time too.
Archaeologists, we are not