Most ship types are historical, and date from the Age of Sail, if not before.
Ships back in those days were rated by the number of guns they carried - a first-rate carried upwards of 100 guns, a second-rate 99-98 guns, a third rate between 64-80 guns, and fourth-rates 46-60 guns. These were all considered suitable for serving in the line-of-battle, meaning that in those days (and up through 1942 really) the tactics revolved around sailing in line-astern formation (basically single-file), and shooting at each other, and/or trying to get across the enemy formation’s bow or stern (crossing the “T”).
So first through fourth rate ships were called “line-of-battle ships”, which got contracted to “battleships”. The vast, vast majority of these were the 74 gun third rates.
Meanwhile, fifth rate ships (40 guns early, 30-32 later) were used as scouts or for independent action- as “cruisers”, meaning that they were fast enough to evade bigger ships and strong enough to run down smaller ones. These ships were typically called “frigates”.
Sixth rates were typically from 20-30 guns, and were typically used for blockade duty, convoy escorts and dispatch carrying, as they were fast and lightly armed.
Even smaller ships were used- typically sloops of war, which were classified as having up to 18 guns, but weren’t “rated”, meaning that their commanders weren’t proper captains, but merely masters & commanders. The French term was corvette for these small ships
So you basically had battleships, frigates, sixth rates and sloops of war/corvettes in terms of ship types, all of which were well-defined in terms of how many guns they carried- a 74 gun ship was a 3rd rate, and was a ship of the line. (incidentally, the US frigates that included “Constitution” were 44 gun frigates, but actually carried upwards of 50 guns- more like a fourth rate)
Eventually with the advent of steam and breech loading guns, the number of guns ceased to be a relevant indicator of a ship’s capability, so they were categorized by what they did, rather than by the number of guns- battleship, cruiser, and corvette were the main categories at first.
With the advent of reliable torpedoes, motorized torpedo boats became popular, and a type of ship was developed to deal with them - the “torpedo boat destroyer”, which got shortened to today’s “destroyer”.
In WWII, the Royal Navy brought back the term “frigate” to describe smaller ships than destroyers, but larger than corvettes, that were used for anti submarine work and convoy escort- what the US Navy called “Destroyer Escorts” at the time.
So with that in mind, during WWII we had the four main categories of ships - battleships, cruisers, destroyers and frigates/destroyer escorts and corvettes.
Aircraft carriers were added as their own type not too long before World War II. Once this happened, battleships were functionally obsolete. The last major surface actions were off the Phillipines between the US and Japan in 1944. Battleships were too vulnerable to air attack, and too short-ranged to remain useful- battles were fought at airplane range, not at gun range for the most part. Missiles only extended that range.
So after the war with the advent of missiles it got murky; ships are mostly distinguished by their roles again- cruisers (Ticonderoga class) are primarily for air-defence, frigates were typically for anti-submarine warfare, and destroyers were all-around ships. Nowadays, it’s mostly cruisers and destroyers, with little functional difference between the two- the Ticonderoga cruisers were actually built on Spruance class destroyer hulls and displace roughly the same tonnage as Arleigh Burke class destroyers (which is very similar to early WWII heavy cruisers!)
In a sense the OP’s got it right- the US Navy(not including support ships) is composed of destroyers (68), cruisers (22) and aircraft carriers (11), with the cruisers performing a specialized air defense role for carrier battle groups, and destroyers doing most everything else.