I'm not sure about leaving luggage at the station - but you could use the secure storage facility in central Madrid.
http://www.spainstorage.com/
There are two luggage storage facilities at the airport:
http://www.airwise.com/airports/europe/MAD/MAD_08.html
Left Luggage facilities are available in two areas, but there are no lockers inside the terminals.
The larger of the two facilities (370 lockers) is at ground level opposite Terminal 1, Arrivals Lounge 2. Large and small lockers are provided. Passport or identification cards are required and bags are security checked.
The second facility (110 lockers) is located on the connecting walkway between Terminal 2 and Car Park 2.
Size - Period - Cost per day
--------------------------------------------------------------------------------
Small Lockers 1 day € 2.65
2-15 days € 3.30
After 15 days € 0.66
Large Lockers 1 day € 2.65
2-15 days € 4.65
After 15 days € 1.33