Madrid is an amazing city - I've lived there for universitary studies - and have never gotten enough of coming back and absorbing some of the atmosphere again. There is something for every visitor: culture, university, shopping (amazing shops with style for no money), parties, parks, friendly people, good food (though you have to know where to get it: I recommend the Latina neighbourhood).
Insider Tip:If you only have a few days before hopping to another city, be sure to walk around Sol, then head up to the park and the Prado for a short visit (free between 6pm and 8pm on certain days: check with your hostel staff!). Enjoy a break in La Latina with some tapas and some beers, and if you like to get some hippie parties, head up to "La Via Lactea" in Malasana/ Chueca and hang around there for some awesome dance parties as well. If you'd like a rather dressed-up party, head back to sol and go out in Joy.