i would recommend 2-3 days in delhi....there are lots of threads in this forum on what you can do in delhi....
if not then landing around midnight is not a problem....there is a hotel in the terminal as well in case you don't want to leave the airport otherwise there are tons of hotels close to the airport....