The NIE Number is an identification number for foreigners, it is a personally, unique and exclusive number which the Police of Spain gives you.
You need your NIE number to do any business in Spain like buying a property, a car or signing any contract that involves business, like contracts for electricity, water etc.
Even if you don’t live in Spain but you inherit a property you need a NIE Number to accept it.
If you live permanently or most of the year in Spain you should apply for a Residencia. You are not entitled to stay legally in Spain for more then 90 days without a Residencia.
Before you can apply for a Residencia you need a NIE Number.
You apply for a Residencia in the Oficina de Extranjeria, which is in the nearest big police station. The Residencia does cost a small charge. For that you have to go with the payment document, which you get in the Taxoffice or the police, to a bank and get it stamped as paid.
When you then go to the police you will need your passport, a photocopy of your passport, passport photos, the Nie Number and the Certificado del Empadronamiento, also a application form and your stamped payment document. You can make a appointment, but you don’t have to.
Certificado del Empadronamiento
These are the registry papers in the town hall. If you live in Spain and want to register a car, get a residencia, or your kids have to go to school in Spain, you want to register in the health insurance, etc for all that you need to register in the Town hall.
To do so, you need you passport and a copy of your passport and ether a renting contract, a bill that states where you live (water or electricity) or if you bought a house you can register with these papers. You need this certificate as well, when you need a new passport from your country.