As in every country, Spain has its own rules regarding the types of residency. And of course the administration process can take some time in order to arrange all the necessary documents, however, the Spanish government managed to design a smooth process which you will need to follow.
The types of residency are:
1. European Union (EU) and European Economic Area (EEA) Citizenship. You have the right to live and work in Spain, but if you stay in Spain longer than three months, then you are obliged to have a Residence Certificate as an EU resident. Moreover, as of July 2012, all EU citizens who wish to stay in Spain for more than three months, should have proof of financial support for themselves and their dependants. They may also be required to provide proof of private or public healthcare insurance.
2. Non-EU/EEA Citizenship. You must obtain a Residence Card (Tarjeta de Residencia) but prior to that, you are obligated to have visa to enter the Spanish territory. The visa process usually starts in the country of origin and the person must hold the visa permit before entering in Spain to later on arrange all necessary documents for the residence card.
3. Non-EU/EEA Spouse and Dependent Family Member. You have the same rights as an EU citizen to live in the country, but during three months after arrival, you must make an application for an EU Family-member Residence Card (Tarjeta de Residencia de Familiar de Cuidadano de la Unión).
Some residence permits and visas need to be renewed on yearly basis. The process is mostly the same as the initial application. You simply need to collect the same list of documents, prove your financial statement and fill in the application form. Fortunately all is computerised and use the latest technology.
For more detailed information, you can visit the website of The Ministry of Territorial Policy (Ministerio de Politica Territorial).