Be it a gas furnace or a wood one, it is risky to keep it running unattended all night. There are risks of fires and carbon monoxide poisoning, so running the furnace for a few hours and then shutting it down is preferable.