There are organizations that are called registries that manage each TLD option. When you register domain names, you would first visit a domain registrar who would in turn check with the registry that manages that TLD to see if the domain is available. If the domain for the TLD you want discovers that it is in fact available, the registry adds it to their registry and gives you access to it. If the domain has already been registered by another user for that TLD, you will be shown during the domain registration process that the domain isn't available.
A domain name registration is simply reserving your website's name for a specified period of time. The two parties involved with a domain registration are generally the user who is registering the domain and the domain registrar. The domain registrant is the user who actually registers the domain name and the domain registrar is the company who helps that user with their domain registration.
Domain names are often seen in analogy to real estate in that domain names are foundations on which a website can be built, and the highest quality domain names, like sought-after real estate, tend to carry significant value, usually due to their online brand-building potential, use in advertising, search engine optimization, and many other criteria.
If you ever change your web host (the actual physical location of your website files), your domain name goes with you. Your regular visitors or customers who knew your site name as (say) www.thesitewizard.com would not have to be informed about a change of web address (also known as "URL"), since as far as they are concerned, the site is still at the same place. They would simply type your domain name and they'd be transparently brought to your new location.