If you own the domain example.com, you also automatically own all subdomains for it. www.example.com is a subdomain of example.com, so is foobar.example.com and baz.www.example.com. Usually you buy the domain without the www., it'd be unusual to buy only the right to the www. subdomain without also owning the parent domain.
What you need to do is set up your host (the server that hosts the actual website) correctly to serve websites for www.example.com and/or example.com. As long as the DNS system is set up correctly to send requests for example.com to your host, www.example.com should work as well. If your host responds to queries for www.example.com and/or example.com with the right website, you're all set. This is pretty standard, usually you don't need to do anything to make this work. It may depend on the host/registrar though, ask them for details.