Well... it is one thing to do that when studying for a test, but it's quite another to do so out of habit. In this case, to help cope with something.
People need an average of 7-9 hours of sleep. In sleeping the brain rests. If a person is deprived of sleeping then s/he will not think very clearly, act quickly, nor would s/he be able to recall very well; and it only gets worse the longer one goes without sleep.
Now if it to be used in order to cope, then whatever you're dealing with it must be something very bad.