Whether or not you can leave oil overnight depends on what kind of oil you're talking about.
For hair oil: It is generally safe to leave hair oil in overnight, but it's best to limit it to once or twice a week. Overnight oiling can help moisturize your hair, but leaving it in too frequently or for too long can lead to product buildup, scalp issues, or greasiness.
For skin oil: You can usually leave beauty oils on your skin overnight, but it's always a good idea to check the instructions on the product label. Some oils might be too heavy for sensitive skin or could clog pores if left on for extended periods.
For motor oil: Leaving your car engine without oil overnight is not recommended. Oil lubricates the engine and prevents damage from friction. Running your car without oil will cause major engine damage, even for a short period.
For other oils: The answer will depend on the specific type of oil and its intended use.