To burn the midnight oil
It literally means to stay up working hard late at night
If you burn the midnight oil night after night, you'll probably become ill.
More about this :
It was probably derived because in olden times people used to use oil lamp at night. To work you need light and lamp can provide you that light.