(covers information from several alternate timelines)
In the 23rd and 24th century, Starfleet vessels were able to check both historical registries from Earth and Vulcan as well as the Starfleet Registry. (TOS: "Space Seed", "The Ultimate Computer"; TNG: "Unification I")
Registry numbers and prefixes
In some governments and agencies, a ship entered into a registry received a prefix that was placed before the vessel's name. This prefix was used to easily identify the vessel as belonging to that agency.
A registry prefix should not be confused with a ship's prefix code.
Vessel prefixes include:
† With Earth's national prefixes (British HMS and Russian VK) still in use up to the founding of the Federation, it is probable that USS still meant United States Ship in the same time-frame, but we only have one example to look at.
Items listed in a registry generally had a number or code to help identify the specific entry.
In some registries, the registry number was preceded by an abbreviation as well:
Aside from the registry prefixes, Starfleet at one time also used letters after the main registry prefix to further define specific types of craft. This was seen in the freighter USS Huron, with its registry of NCC-F1513 and the Template:ShipType ships with the registry NCC-G1465. (TAS: "More Tribbles, More Troubles", "The Pirates of Orion")
The first Earth ship to have warp drive installed, Bonaventure, had an anomalous arrangement of the registry numbers, 10281NCC. (TAS: "The Time Trap") So did USS Nash, with the registry NCC-2010-5. (DS9: "Trials and Tribble-ations")
Shuttlecraft assigned to starbases and other installations were given registries indicating their origin. Such vessels were the da Vinci SB4-0314⁄2 from Starbase 4 and the Picasso SB11-1201⁄1 from Starbase 11. (TOS: "Court Martial", "Let That Be Your Last Battlefield") The shuttlecraft Verne assigned to Relay Station 47 was simply given the registry RS-47. (TNG: "Aquiel")
Starfleet would sometimes use sequential lettering after a registry number was repeated to honor a former vessel. (Star Trek IV: The Voyage Home)
Examples of this include:
|USS Enterprise-J||NCC-1701-J||26th century|
|USS Relativity||NCV-474439-G||29th century|
The most famous registry number, of course, is NCC-1701 of the original USS Enterprise. It was chosen by Matt Jefferies, who was a pilot before joining the Star Trek staff, and based the registry number on 20th century aircraft registration codes. In the early 20th century, the letter "N" indicated a United States origin, and the letter "C" indicated a civilian aircraft. Jefferies arbitrarily added a second "C" for aesthetics. In a sketch  of the Enterprise, drawn by Jefferies, he states the numbers "1701" stand for the 17th cruiser design, serial number #1. Also, upon choosing the Enterprise's registry number, Jeffries decided that the number should be easily readable, so he was careful to avoid numbers that could be confusing, such as 3, 6 and 8. (Star Trek Magazine, issue 162, p. 25)
According to the Star Trek: Deep Space Nine Technical Manual, the registry prefix NXP was used for study models, also called pathfinders, in the development phase of a starship class. For the Template:ShipClass escort, the pathfinder was designated NXP-2365WP/T.
Based on usage – VK Yuri Gagarin and VK Velikan – it is probable that the VK prefix was used on Russian starships in Star Trek. In the real world, the Russians do not use prefixes for their ship names. V.K. however might be an homage to Tom Clancy. In the book The Hunt for Red October, the primary Alfa-class attack sub is named V.K. Konovalov, in honor of Vladimir Konstantinovich Konovalov.
According to the Star Trek: Ships of the Line (2009) calendar (for the month of December), the registry prefix X was used for static test models. An example was the X-17B which was used for evaluating the performance of a refitted Template:ShipClass heavy cruiser in the mid-2260's.