You must complete the residency requirements to get PR on a work permit in Spain. To qualify for permanent residency in Spain, you must reside there for at least five continuous years with a valid work permit. You must also fulfill other criteria, including income requirements and following the Spanish laws. After completing 5 years in Spain and meeting the eligibility requirements, you can apply for a PR at the nearest immigration office.