From the Tor directory specification (emphasis added):
Named – Directory authority administrators may decide to support name
binding. If they do, then they must maintain a file of
nickname-to-identity-key mappings, and try to keep this file consistent
with other directory authorities. If they don't, they act as clients, and
report bindings made by other directory authorities (name X is bound to
identity Y if at least one binding directory lists it, and no directory
binds X to some other Y'.) A router is called Named if the router
believes the given name should be bound to the given key.
Two strategies exist on the current network for deciding on
values for the Named flag. In the original version, relay
operators were asked to send nickname-identity pairs to a
mailing list of Naming directory authorities' operators. The
operators were then supposed to add the pairs to their
mapping files; in practice, they didn't get to this often.
Newer Naming authorities run a script that registers routers
in their mapping files once the routers have been online at
least two weeks, no other router has that nickname, and no
other router has wanted the nickname for a month. If a router
has not been online for six months, the router is removed.
Once the relay gets the Named flag it won't stop other people giving the same name to their node, but since only one node with a given name can have the Named flag, it will allow users to unambiguously refer to your node by name.
Section 6.2 of the Tor Directory Specification is also relevant:
When a client encounters a name it has not mapped before:
If the consensus lists any router with that name as "Named", or if
consensus-method 2 or later is in use and the consensus lists any
router with that name as having the "Unnamed" flag, then the name is
bound. (It's bound to the ID listed in the entry with the Named,
or to an unknown ID if no name is found.)
When the user refers to a bound name, the implementation SHOULD provide
only the router with ID bound to that name, and no other router, even
if the router with the right ID can't be found.