Hanoi might be inferior to Ho Chi Minh City with regard to nightlife but by no means is the city short of activities. There is almost everything that can occupy your time after dark. If you are into cultural shows, Water Puppet Theatre is a good start (read more about Water Puppet Theatre). There are shows every night featuring folk tales and traditional music and they are especially enticing to kids.
If you are looking for less touristy site, Tuong Opera House and Ca Tru Opera House stand out as your best choice. Even the locals come here to calm their nostalgia for the way they use to socialize, long before the arrival of Ipods and Facebook.
A walk around Hoan Kiem Lake might be fulfilling enough for the night
For drinking, the Old Quarter is still your best bet, though Thuy Khue area is growingly a frequent venue for expats. In Hanoi you can find everything for your budget, from the VND 3,000 draught beer to euro-count French brews. Recommended bars include Le Pub on Hang Be Street, Mao Red Lounge at 5 Ta Hien or Dragonfly at 15 Hang Buom (which offers shisha as well).
When it comes to dancing, the bad news is that many of the lively scenes were brought down a couple of years ago due to overwhelming drug problems. The good news is, you can still find some good place to relax yourself to the music, such as Egypt Club at 8 Hang Buom or more luxurious dance floor option such as Nutz at 11 Xuan Dieu.
Walking around at night and you will see a very different Hanoi. Much calmer, and if you come in the fall, you will be surprised by the romance created by the falling leaves and fragrance of flowers on many streets sidewalk. Take good care of your personal belongings. Hanoi is not a dangerous city and tourists are not especially targeting but staying alert will do no harm.