If you put your computer to sleep, it will (as the word "sleep" suggests) pause all current apps running. If you want to run something overnight, go into System Preferences -> Energy Saver and change it to never go to sleep when plugged in (display sleep is ok, but not computer sleep). Also, don't close the lid when you leave it, as that automatically sleeps your computer.