I look at it like a motorcycle chain. A new chain will stretch out a bit when it is new (a recoil spring will shorten). Then it will stay the same for quite a while. When it begins to stretch out again, it's time for replacement. Check the spring free length when new and periodically when cleaning. If you are using a shock buffer, the imprint on the buffer will be a clue.
Recoil springs are dependent on the load usually used. If you are firing light target loads, a lighter spring is in order. If you are using heavy loads, a heavier spring is best. I like to use the heaviest spring that is consistent and reliable with the loads usually used in the firearm at hand.
As mentioned above, A spring that is too light will batter the frame. A spring that is too heavy will make the gun unreliable. Most of the springs I have changed have been mostly been more from guilt than necessity.