Electronic goods have never been cheaper than they are now; conversely, the longevity of the newer electronics on average seems to be much lower. Brand name, model, and dumb luck are still factors, as they always were.
Solid state electronics (amps and receivers) tend to last the longest of all audio equipment, as they have no moving parts, no motors, no belts, no clutches, etc. Heat and dust buildup (if allowed) shorten the lifespan the most in regular use, but 15-20 years is not uncommon for well cared for solid state equipment. A receiver could possibly outlive you.
Speakers, assuming they are not abused, tend to last surprizingly well if kept in a constant climate. I inerited a 10 year old pair of AR speakers when I was a teenager, and they lasted until I moved to the dry climate of Phoenix. Within a month, the woofer surrounds crumbled to dust. : ( The woofer surrounds are usually the limiting factors in speakers. I'd say speakers are more like cars - it aint the years, it's the miles.
My CD players have lasted reasonably well so far, certainly much longer than any of my tape drives used to. Not having a slip clutch or slip belt to balance the takeup reel is a good thing. But it's too soon to tell, really. I'd ballpark them 10-15 years along with speakers.
Keep your electronics free of dust and heat - blow out your receiver with an air can or air gun once a year, and leave several inches of space above it. If it's behind a glass door, leave the door open when it's running unless you have a fan cooled cabinet. Heat is the enemy to electronics, and music is the enemy to woofers.