Beretta recommends replacing every 3,000-5,000 rounds.
The US Army requires replacement when the length of the spring reaches 5" or less. (use the barrel, which is 5", as an easy guide).
Gun springs tend to be overlooked by many, and they are probably the one thing you as an owner can do to keep any gun running well, and for a very long time. It's a relatively cheap thing to do and will pay off in the long run.
I'd stick with Beretta's recommendation, the lower round count (3,000) if you're shooting hotter ammo, or using it for defense. I wouldn't worry about using the higher number (5,000) if you're shooting weak sauce. I think the envelope is probably conservative, but as said several times, springs are cheap. No reason not to stick to the factory recommendation.
I certainly wouldn't cross the Army's line of 5" or less.