Not only is it a fire and burn hazard but 
Using your oven as a heater is not recommended for several reasons: Safety Risks: Ovens are not designed to heat spaces. Using them this way can pose fire hazards, especially if there are flammable materials nearby. Inefficiency: Ovens are not efficient for heating rooms.
A gas oven can produce 800 part per million carbon monoxide for 12 hours and still be rated as safe, but air concentration levels as low as 5PPM can be dangerous. A properly tuned oven should put out no more than 50 when door is closed. But when door is opened it can potentially make dangerous levels.
Leaving an oven on could lead to serious health risks and ultimately death. Leaving an electric oven on and unattended can lead to serious burns or a house fire. If a gas oven is left on and unattended, carbon monoxide poisoning can occur, as can serious burns or fire.
An electric stove is not intended to be a heater and you are asking for trouble if you try to do this. Among other things, the heat they generate is contained in the oven, so even with the door open the heat will not properly circulate.
It's Unproductive. Although standing close to the stove might give you temporary warmth, the unit's design makes it an ineffectual stand-in for central heating. Since it only heats elements on or near it, it can't circulate enough warm air to cozy up your dwelling.
All ovens have a vent that allows some hot air to escape the oven cavity as cooler air enters the bottom of the oven. A vent working well can help keep oven temperatures consistent, but those blocked by grease build-up or bakeware won't release heat properly and can cause the oven to overheat.
There is a low risk of carbon monoxide poisoning with the newer stoves but low risk doesn't mean no risk so definitely avoid leaving the gas on unattended for any length of time.
In fact, aside from your fridge (which runs 24/7), your oven is likely responsible for the highest energy consumption out of all your kitchen appliances.
Please don't leave food in the oven overnight.
Overheating Protection
 Modern ovens are equipped with safety mechanisms that prevent them from getting too hot and causing a fire hazard. If your oven is shutting off due to overheating, here's what you can do: Check Ventilation: Ensure that the vents and fans are not obstructed, allowing proper airflow.
You could certainly preheat for more time depending on the needs of what you're baking (more on that later), but for most baking projects, preheating for longer than 30 minutes isn't doing added good and won't accomplish much beyond driving up your utility bill.
Many ovens and ranges with touch pad clock controls will automatically shut off after 12 hours. The benefit of this is the peace-of-mind and energy savings if the oven is accidentally left on. Models with no clock or timer do not have automatic shutdown.
How long can an oven stay on before catching fire? If you have nothing in the oven, you can generally leave it on for about 12 hours safely if the temperature is low, the door is closed, and nothing flammable is near or inside of the oven. It is also important to make sure that your oven is reliable in this situation.
Generally, a house will stay warm for 8–12 hours after losing heat. However, without intervention, it will eventually reach outdoor temperatures. If temperatures are frigid outside, maximize the warmth by gathering the family in a small room, wearing many thin layers, and placing towels around windows and doors.
The biggest issue with gas ovens is that gas might leak. If the flame goes out but the gas keeps flowing, you could end up with a dangerous amount of gas in your house. This isn't just a fire risk - it could also lead to carbon monoxide poisoning, which is really serious stuff.
Not only is it a fire and burn hazard but heating an apartment or your home with an oven that's on and open can also emit dangerous pollutants and gases into your home. The CDC has long warned to never use a gas range or oven for heating because it can cause a buildup of carbon monoxide inside your home.
Leaving your oven on all night puts you at risk for an oven fire. Not only will you be risking fire hazards, but the gas that comes from your oven can lead to carbon monoxide poisoning. Carbon monoxide is odorless and colorless. So if you were exposed to carbon monoxide, you might not even know it.
Unplug Your Appliances for Safety
 Leaving appliances plugged in increases the risk of fires. Consumer Reports studies show that about half of appliance-related fires are due to issues with the appliances themselves. Often, this happens when an appliance has been recalled, but the owner isn't aware of the recall.
Appliances that run on electricity do not produce carbon monoxide.
How long should you leave food out overnight? According to the Food Standards Agency, “Food that has not been used within four hours can be put back in the fridge and kept at 8°C or below until it is used. If it has been out for more than four hours it should be thrown away.”
If it was a small leak that was quickly fixed, you may only need to wait a few minutes before entering again. However, if it was a more serious issue or took longer to fix a gas leak, you may want to wait up to several hours before returning.
The heat coming from an oven left on for prolonged times can also cause damage to temperature dials and other items nearby. The damage to temperature dials can lead to electrical malfunctions, challenge the oven to work effectively, or, even worse, a fire.
Place the oven-safe thermometer in the center of the middle rack, then remove it once your oven indicates it's reached the set temperature. If the manual thermometer reading is higher than your oven's preset, you likely have an oven overheating problem.
Even if you have an electric oven, it's still dangerous to use your appliance to heat your home. While electric ranges do not risk carbon monoxide poisoning, they come with their own dangers — house fires. When used for prolonged periods, electric ovens can overheat and malfunction.