Madrid does not really do café culture the way Paris or Vienna do — it does tapas crawls. The drink is incidental; the point is to walk from bar to bar in the company of friends, picking up small dishes along the way. The classic circuits are La Latina (around Plaza de la Paja and Cava Baja) on a Sunday lunchtime after El Rastro, Huertas (around Plaza Santa Ana) into the small hours, and Malasaña for the younger and more design-conscious crowd.
A handful of historic cafés are still worth a stop in their own right. Café Gijón on the Paseo de Recoletos has been a literary haunt since 1888. Chocolatería San Ginés, off Calle del Arenal, has served churros con chocolate 24 hours a day for over a century. Cervecería Alemana on Plaza Santa Ana was a favourite of Hemingway's and still feels exactly as it did then.
For nightlife proper, Sala El Sol, Joy Eslava, and the converted clubs of Calle de la Princesa run until 6 am or later — Madrid genuinely does not sleep. Drinking-age rules are loose and a caña (small glass of beer) is around €2.50–€3, almost always with a free tapa.