Properly stored, cooked onions will last for 3 to 5 days in the refrigerator. How long can cooked onions be left at room temperature? Bacteria grow rapidly at temperatures between 40 °F and 140 °F; cooked onions should be discarded if left out for more than 2 hours at room temperature.