At Madrid airport you can check in your luggage 24 hours before the departure of your flight.
At all other airports in the Iberia network, check-in for luggage opens as follows:
Long-haul flights: 4 hours before the scheduled time of departure.
Short and medium-haul flights: 2 hours before the scheduled time of departure.