Discard leftovers within 3 to 4 days or freeze them up to 3 months. These should be stored in a cool, dry place. Yellow onions can stay fresh for a few weeks and red onions can stay up to 30 days. Cut or peeled onions should be stored in the refrigerator and used within a week. Garlic can be kept at room temperature for 1 to 2 months but once itâs peeled, refrigerate and use it within 5 to 10 days.