Tada, problem solved. I know fans would like to believe that every ship ever would get its own unique number, and I have no idea if that is being done in actual navies around the world. But if a future made-up navy wants to reuse numbers because it's easier, why not? It fixes a lot of issues if there actually are over a 100.000 ships.
It depends on the navy, but they all have some method of making sure each ship's number is unique. During World War 2, the RCN had to integrate with the RN, and so our ships used their system for pennant numbers: an arbitrary letter indicating the ship's class (for example, Flower-class corvettes used K whilst Tribal-class destroyers used H or I) followed by a two or three digit number. Nominally that number was just incremented by 1 when a new ship was laid down, but the Dominion navies were usually assigned blocks of numbers to use and the RN proper would sometimes skip numbers to obfuscate the total fleet strength.
With this system no two ships had exactly the same pennant number, but you might have a K100 and an H100.
The USN used a system whereby they combine the ship's classification code (two or three letters that describe what class ship it is) with the actual hull number. Thus you have CV-6 or CV-65, but you can also have CA-65 and FFG-65. To my knowledge, the USN doesn't reuse numbers.
Post World War 2, the RCN shifted to a system that made intuitive sense to the USN but is really just a 3 digit number, with the hundreds digit indicating the ship type. So frigates are 3XX, and HMCS Halifax is pennant number 330. This can also be written as FFH 330, which makes interoperability with the USN easier, but there's no hyphen because the "FFH" part isn't actually part of the number, and there will never be another ship with "330" painted on the side.
Unless, of course, we use up all the numbers; I doubt that will happen anytime soon but they'll need to change the system if it does. Though I suspect it'll be like license plates and just add another digit to the end.
As for the original question, I'd solve it in more or less the same way as another poster suggested but from a different angle:
First, I'd remember that this is fiction. In the real world, this would be solved by logistical and engineering factors that can't really be changed. In my headcanon, or your headcanon, or the official canon, because it's fiction, the authors decide what those constraints are, and can adjust them to suit their story and setting.
Next: decide how many ships are active in your Starfleet, and what percentage of them are undergoing refit at any given moment. You could average this across the fleet, or you could do a dive into individual ship classes. Whatever makes you happy. In the real world, the USN tries to have 67% of its carrier groups ready for sea at all times, but only 50% of the ballistic missile submarines are. In World War 2, the RN tried to have 75% of the fleet ready for sea. Whatever fraction you pick - though I think somewhere between 25 and 35% of the fleet being "in refit" or undergoing repair at any given moment feels about right - you need that many slipways in your shipyards just to maintain the fleet.
Then: decide how many ships per year are being built. You've said you like 700-1,000 new ships per year. Now, multiply that by the number of years you need to build a ship. (Again, you could average this, or you could go deep on individual classes.) If it takes, on average, two years to build a ship, then to build 1,000 ships per year you need 2,000 slipways. If it only takes half a year then you need 500 slipways.
Now decide how many "extra" slipways there are in case of emergency. This number depends on how risk tolerant and resource wealthy your Starfleet is. A fleet with lots of resources can have slipways sitting idle. A fleet with comparatively little resources cannot. (This has nothing to do with money, per se - even in Star Trek, it takes materials and energy to build ships and bases and the Fleet could have lots of those materials, or not quite enough, whichever fits your setting.)
Add all this up and you know how many slipways you need. Now, just decide how many slipways are in each yard. Again, you could simply average it across the Federation, or you could make a really deep dive into individual yards. Either way, divide the number of slipways by the number of slipways per yard, and you now have a number for how many yards you need.
You can go one step further, if you like: determine how many ships Starfleet retires each year so you know how much the fleet is growing by each year, and now you know how many new slipways you need to add each year just to keep up.
Me personally, I like to play in the between TOS and TMP period, and I believe in a "small" fleet of perhaps 100 ships, with a construction rate of 4 to 6 per year, an average build time of three years, and a slowly expanding fleet (at the rate of 2 to 3 ships per year). If 1/3 of the fleet is in refit at any given time, then I need 33 slipways for refits, plus 12 to 18 for new construction, giving me 45 to 48 slipways. Plus two to three per year. I like a resource-constrained Starfleet, so there's only going to be one or two slipways sitting idle - in an emergency, an under-construction or under-refit ship would be delayed to free up the slipway. No idea how many slipways per yard, though, but you see how the math sorts out.