The time it takes for food to spoil depends on various factors, including the type of food, storage conditions, and initial microbial load. Some foods can spoil within a few hours or days, while others may remain safe for consumption for weeks or even months under proper storage conditions.