Infinite.
Relays, Capacitors and LED's have a limited lifespan. Power supplies, HMI's, and VFD's will be the issue. As long as replacements are available, you can run forever.
Well, technically yes, but you have external factors at work here as well.
For example, the other day I had to go online with a PLC-5 and the only port available was DH+. Now, software-wise, RSLogix5 will install on a Windows 7 machine so that's not an issue, but the problem is hardware. Modern laptops only come with half-depth PCMCIA slots, so the 1784-PCMK card can't plug into them. The only way to get online DH+ with a modern laptop is A) buy the $3,000+ USB adapter from Rockwell, or B) lug a Control Logix rack with a DHRIO and ENBT card installed in it to the job site. The only other option is keep an old laptop around with a full-depth PCMCIA slot and the hardware/software.
The one laptop we have in the company that can get on a DH+ network belongs to a technician who just retired. I had to drive to his house to borrow it. Now, I did eventually get online and troubleshoot the machine. Heck, if I really wanted to I could hook up to a PLC-2 or SLC-150 if I needed to. But guess how much time I spent hunting down all the equipment I needed to get online with that PLC-5? About half a day. And I'm billing that. And this situation is only going to get worse. Once that laptop goes kaput for good, we will probably have to start telling customers with 30-40-year-old PLCs that we just plain can't help them. As time goes on, we won't have the knowledge nor the tools to do so. Even in cases where we do, the customer is going to pay more to service that machine, because we have to spend more time digging up old hardware and re-familiarizing ourselves with the software.
Hardware life is only one part of the equation when it comes to obsolescence. Serviceability is the other, and as laptop technology advances and changes, it's going to be a struggle to maintain support for legacy systems. You can theoretically keep a car running forever if you simply keep replacing parts, but there comes a point where it's no longer financially practical to keep it running as a daily driver. At that point, you either junk it or continue putting money into it as purely a labor of love. And I don't see a lot of industrial machinery kept around to serve as museum pieces.