I would say the minimum number is 2. Magazines can, and do fail. Without a spare, you are done, if the one goes bad (for any reason).
Common defensive arms, and those used for games need multiple mags, both for the above reason, and often just to be able to compete in a match.
Note how virtually all quality semi autos (other than .22s) usually come with a spare magazine. Without a spare, you lose one of the major advantages to a semi auto, the rapid reload.
But magazines can be lost, or damaged, and they do wear out faster than the rest of the gun. Thin metal, holes that can become worn, springs that can wear out, mag lips that can become bent or deformed. Sometimes just dropping a mag on a hard surface can be enough to screw it up.
And, lets say you can't easily or cheaply get replacements? How many would be enough to ensure a lifetime of reliable use?