The current rule
Spain moves forward at 2:00 a.m. local on the last Sunday in March and back at 3:00 a.m. local on the last Sunday in October. Peninsular Spain runs UTC+01:00 in winter and UTC+02:00 in summer. The Canary Islands sit one hour behind the mainland and change on the same dates.
Why Spain is on the wrong time zone
Spain lies almost entirely west of Greenwich and belongs geographically on UTC+00:00 alongside Portugal and the UK. In 1940 Franco moved Spanish clocks forward to align with Nazi Germany, and the change was never reversed. This is the structural reason behind the famously late Spanish day: lunch at 2 p.m. and dinner at 9 p.m. are, in solar terms, an ordinary 1 p.m. and 8 p.m. A government commission recommended returning to GMT in 2013; nothing came of it.
The Canary Islands
The Canaries run on UTC+00:00 in winter and UTC+01:00 in summer, an hour behind the mainland year round. Spanish broadcasters habitually announce times as "una hora menos en Canarias" — one hour less in the Canaries — which is a rare case of a national timekeeping quirk becoming a stock broadcasting phrase.