The International Astronomical Union's Naming Astronomical Objects webpage is a comprehensive guide to how astronomical objects are named.
For example, for "Specifications concerning designations for astronomical radiation sources outside the solar system", the IAU states that the designation (or sequence of letters and numbers) follow a general form:
Acronym ^ Sequence ^ (Specifier)
Where the Acronym
is a code (i.e., alphanumerical string of characters) that specifies the catalog or collection of sources.
The sequence (or numbering) is an alphanumeric string of characters, normally only numerical, that uniquely determines the source within a catalog or collection. It may be a sequence number within a catalog (e. g., HD^224801), a combination of fields, or it may be based on coordinates.
and finally, the Specifier
The specifier is optional and allows one to indicate other source parameters. However, they are not required syntax and are enclosed in parentheses.