Yes they wear out. If it has a built in amplifier, the older the sub gets the more out of spec caps and resistors will get. Depending on how hard the amp is driven other stuff may wear out as well, but odds are you won't know until you know.
They driver can wear out as well. If it's been sitting in the same orientation for many many years, you get more and more sag over time, especially with heavy cone drivers. The materials and glue will also wear out due to time and use.
Generally speaking, the time it will take for any given amplifier and driver to completely wear out will depend on many different factors, especially build quality and it has been used over that period of time. If it still looks good, sounds good, and is from a pretty reputable company you can most likely expect 10-15+ years of happy use without having to worry about anything. If you really want to, you can always pull the driver and do a visual inspection and just see if everything looks right.
If you're careful, you can give it a little stress test by running some tones through it at moderate volumes and see if it makes any noises it shouldn't or if anything else seems iffy. Otherwise just enjoy it and keep those fingers crossed.