Any new arrivals to the beautiful lands of Spain will need an NIE number, for a variety of reasons. New permanent residents, seasonal workers, property buyers will all need to go through the process of applying for and obtaining an NIE number, meaning Numero de Identidad de Extranjero.
The application process of the foreign identification number recently changed meaning an application must be made in person by the person hoping to obtain a number. Slightly confusing however, the number you are originally given will be your individual number for life and will never change, on the other hand, the NIE certificate which you are able to collect from your local police station is actually only valid for 3 months, so it has a very short life.
There are a couple of choices that you have once the certificate is nearing the end of its life. The first option is that you return to your home country, or the second, if you want to permanently stay in Spain and register as a foreign resident you can apply for a Certificado de Residencia. This can be done so here: http://extranjeros.empleo.gob.es/es/ModelosSolicitudes/Mod_solicitudes2/18-Certificado_Residencia_comunitaria.pdf
Just to reiterate, should you leave the Country after your initial 3 months have passed, upon your return to Spain you will have to apply for another certificate or apply for residency. Any bureaucratic undertaking in Spain will require the participant to have some valid identity, so make sure you keep on top of this!