When the weather gets colder Madrid attracts much fewer visitors. It's the best time to visit its famed museums, as lines get much shorter than in the summer. Hotel prices also drop at this time with the exception of Christmas Holidays. From mid-December to early January Madrid gets flooded with tourists again.
Winter in Madrid can be both cold and rainy, so most outdoor cafes will be closed as well as rooftop bars. You won't see crowds at Puerta del Sol or other popular squares. However, the temperature rarely drops below zero so it's still possible to explore the city and enjoy its deserted streets.