The question of what is "enough warheads" is not an easy one, and changed over time both with differing international and domestic conditions, different technological capabilities, and different strategies. I've written at some length on this before so I won't repeat myself there, but as an illustration, if you think there is a 50% chance that each missile won't hit your target, then you'll need some multiple of the number of targets if you want, say, 95% confidence that it'll be destroyed. If your war plans involve using low-yield, tactical nuclear weapons to counterbalance against an enemy that has many thousands more tanks than you do, then you're going to want a huge arsenal of these small nukes. If your idea of the purpose of your arsenal is to target the enemy's arsenal, then your size will be pegged at something similar to your perception of the enemy's arsenal. If their arsenal is similarly arranged, then you have the potential for massive numbers. And so on.
Separate from these factors, nuclear arsenal sizes were also affected by non-strategic factors like interservice rivalry (the Army, Air Force, and Navy each wanted a similar number of nukes, because they thought they brought with them prestige, funding, importance), perceptions of prestige and "arms race" dynamics in general (where large numbers were associated with more security, rightly or wrongly), and, at times, a lack of overall planning and oversight (in the US, through the 1960s, the military just ordered as many systems as it could field, and as many warheads as it could produce, without very much attention to the question of whether they had good reasons for this — this was enabled, in part, by the high degree of secrecy that surrounded stockpile production decisions, which limited the amount of oversight).