Due to the sheer amount of questions we receive about this, we'll try to clear this up as best we can:
Web hosting in most cases is exactly what it sounds like - hosting for a web site where all of your website's files would go. However, what many do not know is that a domain name (e.g. yourdomain.com) is actually a separate service from web hosting itself. Domains are simply a name that points to your web hosting server's IP. Without a domain name, you will have to type in an IP address to access your website, which of course isn't exactly fun to do.
Domain names are purchased on a yearly basis from domain registrars. Web hosting will be purchased from web hosting providers (usually on a monthly basis). Once you have both, you will receive a list of nameservers from your web hosting provider, which you have to setup your domain name to point to from the domain registrar's control panel. This will make the top level domain (e.g. yourdomain.com) point to your web hosting server. The subdomains of your domain (e.g. sub.yourdomain.com) and other DNS records will be setup through the web hosting's control panel from that point on.