Permanent residence in Portugal can be obtained after residing continuously for 5 years with a valid residency permit. After 5 years of legal residency, you can apply for a permanent residence permit and, potentially, one or two years later, for Portuguese citizenship.