The usual upper limit for non-residents is 30 years but your age will be a determining factor
Some lenders will allow Spanish citizens to borrow for up to 35 years, but the maximum term tends to be lower for non-residents. The usual upper limit for the length of a mortgage for non-residents in Spain is 30 years.
Your age will also be a factor in determining the maximum period over which you can repay a mortgage. Spanish banks will apply a final age of 70 years old, or sometimes age 75 at the end of the mortgage term. That means, in most cases, if you are 59 when you apply for a Spanish mortgage, that you have a maximum mortgage length of 11 years.