Cooked spaghetti lasts for 3-5 days in the fridge. Store it in an airtight container. Always check for signs of spoilage.