Spaghetti squash is a very hearty vegetable. They will last on the counter for at least a month, sometimes longer. You'll know a spaghetti squash has gone bad when you cut into it and it's slimy or moldy. Cooked spaghetti squash lasts for about 3-4 days in the refrigerator.