Depends on the gun and type of spring. I am particularly fond of the ISMI flat-wound springs that are OEM stock on the M&P semi autos, which last far longer than piano-wire springs, including a full year of competition up to 50,000 rounds for one of our Oklahoma champions the year he made Master.
For a GI 1911 using the finest piano wire springs, I compare the recoil spring to a new one, and replace when the spring becomes 1/2" shorter.
Simpler than counting rounds.
In the M&P, the recoil spring is probably the least likely spring in the gun to fail; trigger spring and striker spring are more common failures that I've seen in matches. As always, YMMV