One of those perennial questions for which the "answer" lies within the individual, including considering the individual's knowledge, training, skillsets, interests, experience ... and preferences.
As a young cop I used to only carry a couple of off-duty weapons, a Commander and a Security-Six. That eventually changed into more examples of that couple of types of handguns. Similar, but different models. It continued to evolve. Why? Several influences were involved.
I could afford to buy more handguns.
I had a safe in which to store more of them (kids started toddling, so guns got safely put up out of the reach of inquisitive hands and fingers).
I had more opportunity to use a private LE range, versus the expensive public ranges.
Finally, I became trained as a LE firearms instructor, and really started to focus on training with various handguns commonly used. I shot and practiced (trained, qualified, etc) with a lot of different guns. Frequently. Repeatedly. Continually. On the agency's dime, using the agency's ammunition.
Then, I started attending various armorer training, for an ever growing variety of firearms. Even if I didn't own some of the guns of the types I helped support/repair, I got ample opportunity to handle and shoot them.
By the time I retired, I learned I had acquired a list of more than 35 handguns (as best I can recall) with which I'd qualified and had listed in my training record. I stayed on as a firearms instructor and armorer post-retirement, working as a reserve, and continued to use various guns in my capacity as an instructor and armorer, and even added to the ones I'd normally used. However, considering the records-keeping and extent of the various training records, I started to simplify the guns I used for the range, and the ones I carried as retirement weapons. The numbers listed dropped down in the 20's.
Revolvers (mostly DA/DAO, but I first learned my revolver skills on SA wheelies, and still have an affinity for them), 1911's, some models of TDA (DA/SA) and DAO-ish pistols. Pretty much the ones I still like using and having as options for retirement CCW.
Like most of us, I've long heard the old saying about "beware the man with one gun, as he might know how to use it." Well, as an instructor who has seen my fair share of cops who only owned ONE off-duty weapon, or private citizens who only owned one handgun (I helped teach classes for private citizens for about 10 years), I've had ample opportunity to develop a corollary of that old saying ...
"Beware the man/woman who only owns one gun, as he /she might not be interested enough in gun ownership, and developing shooting skills, to have learned how to safely handle it and shoot it well."
I've invested all of my adult years in the pursuit and practice of some martial arts. Not just one style, art or discipline. There are some advantages to learning to effectively use more than one.
As a firearms instructor, I've been required to be familiar and skilled using more than just one or two handguns I "liked", or was issued, including many of them which I'll never have a desire to personally own.
If someone considers themselves well versed in shooting handguns, and well served by only being familiar with one make/model/caliber, that's their prerogative. Me? I want to be able to use virtually any handgun I may have cause to pick up.
Plus, I still enjoy being able to demonstrate skill at shooting all of the handguns with which I've become familiar over the years.
So, I think of the answer to the question of "how many" as being ... "it depends", meaning on the individual.