Domain names are like the current website called "macrumors.com". You pay a yearly rent for the domain name.
On the internet a computer has an IP address, often written something like 118.11.103.12 ( Note I just made up the address ) .
So, if you know the IP address you can connect to the various services on the server from anywhere in the internet world. If you do not want to remember the IP address, the domain name can be given instead. Functions in the net does the lookup for you, the function you see is called DNS.
So basically, if you want your computer to have a globally known domain name, you have to rent the name and also rent the translation service (storing your domain name and the ranslation into IP address) from someone "on the net". There are service companies that does this for a fee.
But, for a server at home, there often is an additional complication as the IP address is not static. Instead you get a temporary IP address which might change once a day or so. Some internet carries allows you to pay extra for a static address.
Even if you cannot get a fixed IP address from your internet carrier, there are solutions.
But, it is not uncommon for your internet carrier to block incoming calls to your server, unless you pay extra charges.
Beeing a server owner can sometimes be a bit complicated.
// Gunnar