People tend to look at answering this question with an exact number. For me this is the wrong approach. I think of it in "sets" or to steel from the army "combat loads."
I have a number of mags I use with each firearm generally (1 set) So for a concealment pistol that might be 2 mags, for a duty pistol it might be 3 or 4. For an ar that might be 7 or a bolt gun 2. Basically how many mags I use at one time.
Then I think about how I use it and how many sets I need.
1 set for practice (don't want to load and unload defensive ammo for practice)
1 set if I use the gun defensively or for hunting (want to verified good mags that haven't been dropped 100's of times in practice)
1 set for competition/classes (want to verified good mags that haven't been dropped 100's of times in practice)
1 set for backup Don't want to have to wait for something to be in stock or for the UPS man if a mag breaks.
1 additional set if the gun uses mags that hold over 10 rounds as I am sure there will be a new federal ban in my lifetime.
The number of sets very by gun, the size of the set varies by gun.
Ruger MKIV that I use for plinking. Feel perfectly safe with a couple of mags and a couple of backups.
10/22 Tac Sol I use for plinking 2 for the range, 2 for backup for the 10 rounders 2 bx-25 for the range, 2 bx-25 for backup, 2 bx-25 ban insurance.
Main pistol that I take to classes - 3 for practice, 3 for defensive use, 3 classes, 3 for backup and 3 for ban insurance.
AR's - I just have a shit ton.