For USB devices, lifespans vary greatly from device to device. For things like flash drives and external hard drives, you can expect anywhere from a 3- to 20-year lifespan when used carefully. This means not dropping them, connecting and disconnecting them gently, and storing them within the temperature limits. You can see how SSDs, HDDs, and USB flash drives compare to see the different lifespans.
For any device with a USB cable, the device itself could last for years, such as a keyboard. But, if the cable is damaged, the device can no longer connect to your PC.
USB ports can wear out over time. The exact lifespan varies based on how rough you are with them. Constantly plugging in devices with too much force and jerking them out at angles will damage the port. I personally have USB ports on older PCs that are still working over 15 years later, and this is with connecting/disconnecting a USB drive almost daily.