I agree with Castiza. The metro is safe at all hours, and remains in my mind the best utilitarian way to travel in Madrid. Her schedule is correct. If you find yourself needing to get around late at night and not wanting a taxi, you should be able to catch a "buho" or night bus which make long runs combining routes with fewer stops. Taxis from point A to B in Madrid are great too, and fairly reasonable. Have fun in Madrid!!!
_________________________
Ongi etorri!