Nascar technically "owns" the numbers but the teams "lease" them for a pittance, I seem to recall it being less than a set of tires. As long as a team continues to make the payment on the number, it's theirs in perpetuity. Childress makes the payment to maintain the #3 for example.
I've heard some talk that when Nascar mandates no more than four cars to a team that it will mean only four numbers will be available to each team. If Childress ever went to four cars, he'd be forced to use the #3 or lose it.