I got this question in the comments section of a random post. Figured I might as well answer it on here. Like a lot of things this is a pretty personal issue and there probably isn't a right answer. Anyway here is my personal opinion.
To me the minimum for a core (versus the ancient .25 auto you got handed down or whatever) defensive pistol I consider 10 magazines the minimum. My thinking is as follows. My worst case load out for a pistol is 1 mag in the gun and two spares on me. Some jerk in a forum might think carring 10 pistol mags is cool but I carried 3 in an actual war so their opinion is meaningless to me. Here is how I look at 10 mags: 3 to carry, 3 to rotate them with, a couple to lose and a couple to give away/ trade.
I consider 10 a minimum because, particularly if you may purchase more handguns of the same model later or want to stash some mags and ammo here or there that number gets smaller real fast. Also mags wear out and can get lost. Personally I have lost precisely 1 pistol mag in my life but I have misplaced (to me the difference is misplaced stuff gets found eventually) a lot of them. 20 pistol mags might be a bit much but 15 could be a nice number.
If you are a college student or on a low income and chose to get a pistol with expensive mags then 10 is probably plenty. At least get 6. However if you chose to get a pistol with good mags at $20ish or less then 10 mags isn't a big deal and 15 or maybe even more isn't going to break the bank.
One thing to remember about mags is that they are not covered under the Second Ammendment. Their cost and availability can change drastically almost overnight. I remember towards the end of Bill Clinton's gun ban full capacity factory Glock magazines cost somewhere around $100 when you could find them. It was a huge deal that my buddy Chad had ONE full capacity Glock mag. Since the end of said tyranical ban and me coming into survivalism I decided to stock up on a decent amount of mags (10). More recently as I now have a bit of disposable income I have decided that I will not be caught with my proverbial pants down not having plenty of mags should anything happen. Most mags are affordable enough that not stocking up is just foolish. You can buy Glock/AK/AR mags for $20 or under all day long. Most .308 mags are readily affordable as are military issued semi auto pistols (1911, Beretta 92, Browning HP). I have stocked up on mags because I don't want to run out of them and if a friend decided to buy a Glock after a ban, it would be a real nice present to give them a full capacity mag or two for Christmas.
Well those are my .02 cents on that. YMMV