Once they have been cut or chopped, yellow onions generally last 7–10 days if you seal them in a container and refrigerate them. Whole onions last 2–3 months in the pantry or refrigerator and 6–8 months in the freezer.