A Spain student visa (Type D) lets non-EU citizens stay over 90 days for approved studies, like university or accredited courses.
It allows part-time work (up to 30 hours/week) and requires proof of admission, financial means (€600/month), and health insurance.
It’s an Estancia (stay) visa, so it doesn’t count toward permanent residency or citizenship—you must switch to a Residencia visa to stay long-term.