1) Registry Numbers
We're all familiar with the designation "NCC-1701". This is the numerical I.D assigned to the Enterprise, she is the one thousand, seven hundred and first ship to be built and operated by Starfleet. This gives us our first and best clue to determining Starfleet's strength: the USS Excelsior has the designation "NCC-2000", which is the highest we see in the classical Trek era. The same movie that introduces the Excelsior also tells us that the Enterprise has been in service for forty years. So Starfleet can build 300 ships over the course of four decades.
2) More Construction
It takes them two years to refit the Enterprise between the five-year mission and the Motion Picture, where she is described as practically a "brand new ship". Star Trek V claims the Enterprise-A is a brand new ship, but I tend to rather accept the theory that she is a re-named Yorktown (Rather than Starfleet still building a class of ship they seem to find outdated, in just one year, that's superior to the aging original!). So a Starfleet ship takes about two years to make, with seven new ones every year.
2) The Grissom
As far as I am aware, the science vessel Grissom has the lowest registry number seen in the classical Trek era, NCC-638. Interestingly, this would make her far older than the soon-to-be mothballed Enterprise (Over 160 years old!) If production numbers stayed consistent and I don't see why they wouldn't with all the threats to defend against and final frontier to explore. Undiscovered Country (Movie VI) is the first time we hear of cutting back on Starfleet, due to the immanent peace with the Klingons. The Grissom is a purely scientific vessel to be fair, which presumably demands less than a Starship-class.
3) Casualties
So Starfleet could be fielding as many as 1,100 ships. That does not, however, account for lost ships. The best figure we have for that is the Constitution-class: We know that at the time of Kirk's five-year mission the Enterprise had 12 sister ships. 5 are destroyed over the course of these voyages (Since we manage to go through TAS without losing anybody). The Constitution is the most powerful class of the time but also given the most dangerous missions, so I think it's fair to call this the "average": 1.6 ships lost out of 13 over the course of 5 years
4) Math
300 built from the Enterprise to the Excelsior (With possibly as many as 1,063 still in service from before), with a projected 56 new ships after that leading up to Star Trek VI where production is slowed. With a loss rate of about 23 ships a year, that's only 314 Starfleet ships still in service. No wonder the Enterprise is the only ship ever within range to defend the Earth!
5) But what class are they?
Although there were only 13 Constitutions during the course of TOS, the films give us more than 13 names so they obviously built more (How many more I couldn't guess). We only ever see the one Excelsior class, but I would think many of those 56 additional ships they built would be Excelsior, meant to replace the Constitutions they were phasing out. The Miranda-class is smaller and seems more like a workhorse than these Starship-class vessels, but none of them we see have a registry lower than 1800, so I'm led to think they're a relatively recent model (newer than the Constitution-class, anyways). So I'm lead to think a bulk of Starfleet is older science vessels like the Grissom. Which makes sense, given their insistence that they're not a military organization first, but an exploratory force.
6) Enterprise-A
None of the above accounts for ships re-using names, like the Enterprise, without changing registry (still NCC-1701). The Enterprise seems to be the only one who gets this treatment though (Note the lack of a Defiant-A & B in DS9, despite the loss of the original Constitution-class Defiant in this era), so I think it balances out by my not accounting for re-used ships with a changed registry (Like the theoretical Yorktown conversation)
7) Yes, I know
There are quite a few logical & mathematical leaps in my conclusion. And a lot that I could clear up just by referencing Enterprise & Discovery. But I think It's fun, honestly, to jump through my logical hoops to use only the classic era material to reach a conclusion. Classical Trek, with all it's Odd and janky world-building, sometimes feels like a completely different Universe than later Trek. And really, I'm okay with that
8) The Lost Sisters
Just going to stick this here, so I don't have to make a new post. The known, lost Constitution-class ships are: Defiant (transported to another Universe, all hands lost) Constellation (Sacrificed to stop the Doomsday Machine) Intrepid (Eaten by a space cloud. Crewed by all Vulcans, I wonder if there's a similar ship with just Andorians or Tellarites?) Excalibur (Badly damaged by the Enterprise, all hands lost) and the Exeter (A plague wiped out the crew. We are never told if Starfleet managed to cleanse the ship or if it had to be destroyed)
9) The quick answer, if you skipped to the end
It is my guess that Starfleet fields around 300 ships at any time, with about 1/15th of those being starship-class