You have to go to the New Delhi Railway station Paharganj side at the last counter before 8 AM or 8 PM with your ticket and one valid ID card with your address. It there is any room, they will allot you room for 12 hours or 24 hours as per your request. Here, it is the winter season and most of the trains are going late, so there is a minimal chance to get a retiring room.
Anyway, Best of Luck.