You buy them through a registrar. NetworkSolutions.com was the original one, but now there are many (cheaper) registrars. Personally, I've been using namecheap.com lately. Godaddy.com is another popular one.
arn
To the OP:
As you start looking at registrars to purchase a domain name, and probably host your site with them, please take care and read the terms of service and the agreements very closely. I have a few domains registered, but I used Network Solutions as the registrar. I then found a hosting company that suited the needs I had and signed up with them. Once I got the information I needed from the hosting company (in particular, the IP address of my site), I then went back to Network Solutions and filled in the proper information for the DNS. This way I control my own, and am not tied into any one hosting site.
Consider this - if you want to change hosting, then simply sign up with the new one, install your web site, and when you are satisfied, then change the DNS at Network Solutions to point to the new place. The changes take a bit to propogate through the system, sometimes a few hours, sometimes only minutes if you play the cards right.
Yes - domain names can be cheaper at other places, but those damned TOS's and Agreements (have you ever really read the one at Go Daddy) sometimes drive me mad. And sometimes you end up getting what you pay for - cheap. <rant off>.
Network Solutions is not hard to work with and it's really a good thing to learn. Now - I get nothing from them for saying this - I am simply speaking from the last 12 years of experience working with them and maintaining networks. Now retired and loving it!!!
Arn - nothing against you or anyone else using the less expensive registrars - the above views are mine. I also had the luxury of running the primary DNS server(s), so that helped the situation.