What USS Really Means In The Star Trek Franchise
As any Trekkie will be able to tell you, the registry number of the U.S.S. Enterprise is NCC-1701. In "Star Trek IV: The Voyage Home," a new Enterprise was built with the registry of NCC-1701-A, establishing canonically that starships can keep the same name and designation over multiple generations. Indeed, on "Star Trek: The Next Generation," the registry number was NCC-1701-D, replaced by the Enterprise-E in "Star Trek: First Contact" in 1996.
Although it's not explicitly talked about in "Star Trek," the presence of a registry number adds a great deal of canonical depth to the franchise. In the future, starships will still be numbered and cataloged like modern-day naval vessels while also being overseen by a navy-like military. Starfleet, however — unlike modern military bodies — devotes its strict military system to exploration and study, not war or conquest. The registry numbers also imply a vast, behind-the-scenes bureaucracy at work, with unseen pencil-pushers constantly working hard to keep a vast military fleet in order. An organization as large as Starfleet would, realistically, require millions of bureaucrats keeping it afloat. The registry numbers give "Star Trek" a realistic tinge.
As for the U.S.S., that is part of a much older tradition, going back centuries. If Starfleet is to be likened to the modern navy, then the starships would follow in the same nomenclature, and adopt the "U.S.S." from older times. Sometime in the early 17th century, British ships were gathered as the Royal Navy, and all the vessels under its purview were designated His Majesty's Ship or Her Majesty's Ship. All the navy's vessels were, hence, given the prefix H.M.S., as in the H.M.S. Pinafore or the H.M.S. Surprise.
When the United States started building a navy, U.S.S. was used, standing for United States Ship. In "Star Trek," U.S.S. merely stands for "United Starship."
The real-life Enterprise
U.S.S. is also an expansion of another centuries-old nautical abbreviation. Many smaller ships also used the prefix S.S. on their hulls, e.g. the S.S. Minnow on "Gilligan's Island." S.S. referred to a single-screw steamship, or screw steamer, a generic term for any steam-powered sea vessel. One might also know about the maritime prefixes S.S.C.V. (semi-submersible crane vessel), S.S.S. (sea scout ship), or S.S.V. (special support vessel). After 1901, most designations were abandoned by then-President Theodore Roosevelt's administration.
Every country has its own similar abbreviations, of course, but Starfleet adopted the American system. This is because, well, "Star Trek" is an American show created by an American man. Also, within "Star Trek" canon, Starfleet was founded in the United States. Federation headquarters and Starfleet Academy are located in San Francisco. Had "Star Trek" been created in Canada, say, the ship might be called the H.M.C.S. Enterprise.
The U.S.S. Enterprise on "Star Trek" was named after, well, the U.S.S. Enterprise. In real life, the Enterprise was a Yorktown-class aircraft carrier that was built in 1938 and fought extensively in the Asia-Pacific War. It was one of only three aircraft carriers to survive the conflict, and was eventually decommissioned in 1947. When "Star Trek" creator Gene Roddenberry learned about the Enterprise, he was fascinated by its campaigns and decided to use its name on his science-fiction series. Originally, Roddenberry wanted to name his ship the U.S.S. Yorktown, but changed his mind. It's a good thing, too. "Yorktown" is specific to Earth. "Enterprise" is more universal.
Incidentally, "Yorktown" was eventually used for other ships and stations in "Star Trek," including for the outsize colony seen in "Star Trek Beyond."
It does NOT stand for 'United States Ship'
It seems that Gene Roddenberry once got some jingoistic pushback from studio executives over what U.S.S. should stand for. Because it was already used on American navel vessels, some of the higher-ups at NBC assumed that the Enterprise was an American ship and that the future was ruled by America. "Star Trek," of course, takes place in a placid future when the Earth has become united and countries have more or less been eliminated.
In Stephen E. Whitfield's invaluable sourcebook "The Making of Star Trek," the author explained that NBC executives wanted the Enterprise to be described as "a good, safe patriotic United States spaceship." Roddenberry evidently personally fought against this, feeling that the future belonged to the entire planet Earth, not to the United States in particular. Whitfield's book finally states categorically that U.S.S. stands for United Starship, which is in keeping with the multiculturalism that's always been a seminal part of the franchise.
As for on-screen mentions, in the original "Star Trek" pilot "The Cage," and in the episode "Patterns of Force" (February 16, 1968), dialogue implied that U.S.S. stood for United Space Ship. This is one of those details, however, that Trekkies tend to half-ignore, like they did when Spock (Leonard Nimoy) referred to himself as Vulcanian, not Vulcan. In an official capacity, U.S.S. stands for United Starship.
Whether or not U.S.S. is still used on seafaring vessels in the 24th century, however, is not a detail "Star Trek" has ever bothered to address.