Perennial subject which never results in any agreement ...
Different manufacturers express different opinions, as well.
I've seen magazine springs in service-type pistols remain serviceable anywhere from a few years to several years when left fully loaded. There's always the possibility of a defective or out-of-spec spring, as well as somebody damaging one, too.
I've known of manufacturers recommend spring replacement in their armorer classes differently.
Some recommendations have been based upon considering & observing spring performance in actual live-fire conditions and/or in bench checks/inspections, and some have involved considering the number of rounds actually fired as well as how long the service magazine was being left fully loaded.
Sometimes the design of the magazine and spring may have an influence on a recommendation, too.
In my last Glock class the instructor discussed comparing a 'used' spring's length to a new/unused one kept aside as an exemplar, as well as doing a couple of bench checks with EMPTY pistols (rapidly running the slide to see if the magazine spring will tension the follower firmly enough to engage the slide stop lever to lock the slide open, and checking to see the spring will cause the empty magazine to noticeably jump 'upward' when the magazine catch button is depressed on an empty pistol when it's held upside down).
Glock is more specific when it comes to replacement of recoil springs, though. The factory recommendation is presently to replace recoil springs every 3,000 rounds ... although you can also hear some Glock employees mention an even shorter replacement interval when asked.
In recent years S&W has commonly recommended recoil & magazine spring replacement either every 5,000 rounds fired, or else after 5 years of a magazine being left loaded. One time when I asked about this I was told that this is likely a conservative recommendation.
FWIW, a recommendation previously taught in an earlier S&W armorer class used to involve trying to 'shake' loose the top round of a fully loaded magazine by a 'wrist-snap', and if the round was dislodged the spring should be replaced. At that time we were told that S&W has maintained an inventory of fully loaded magazines in one of their vaults for many years, and had been engaged in frequently removing and testing magazines which had been left fully loaded for various numbers of years. We were told of magazines which had demonstrated normal function after more than 10 years of having been left fully loaded.
On the other hand, I know an armorer for another agency who issues S&W pistols chambered in .40 S&W, who once told me that his inventory of issued pistols had started to exhibit feeding issues once approx 7 years of in-service use had been reached. I was using one of his magazines in a 4006 one time, and sure enough, the older magazine spring caused it to exhibit feeding failures while a new magazine spring is a similar old 4006 magazine exhibited normal feeding & functioning (it had the early yellow follower in it when it was brought to me, which I replaced with the current blue follower when I replaced the spring).
The instructor in my last Colt class was still recommending that 30-rd AR magazine be left down-loaded by 2 rounds in LE rifles/carbines which are left sitting in patrol vehicles for months at a time, and recommended replacement of 1911 magazine & recoil
springs approx every 1,800-2,500 rounds, and to consider the potential for decreased service life of the springs when +P ammunition is used.
Now, lots of folks like to post about their experiences with pistol magazines which had reportedly been left loaded since either of the first World Wars, and how they functioned fine when used in a pistol in the present day. Fine. Doesn't necessarily mean all of those era's 1911 springs will exhibit the same functioning under the same conditions, though.
I often think of threads like this when I'm teaching a CCW class & qualification range. More often than not, the firing line has to wait while somebody resolves a feeding issue which appears to be caused by a weakened magazine spring. It's not uncommon to have classes where this may involve more than a single shooter using a semiauto pistol, too. I remember one class where 4 guys were using various magazines which had magazine springs which seemingly weren't keeping the rounds rising fast & firmly enough to be properly fed from the magazine lips. It's an unusual (but enjoyable) class where someone doesn't have a magazine-related feeding problem usually related to what appears to be a magazine spring exhibiting weak tension.
Also, while there have been some folks in CCW classes who have claimed to be frequent shooters (including a couple folks who enjoy competitive shooting pursuits), the majority of the folks whom I ask about their practice regimens generally admit to only shooting their CCW weapons either for the qualification class itself (every 2, 3 or 4 years in CA), or just in preparation for the class/renewal qualification.
Replacing magazine (& recoil springs) might be considered as relatively inexpensive insurance when it comes to preventive maintenance and helping keep semiauto pistols used as dedicated defensive weapons in normal functioning condition.
So is periodic inspection, cleaning & lubrication, too.