To maximize the shelf life of cooked pasta for safety and quality, refrigerate the pasta in shallow airtight containers or resealable plastic bags. Properly stored, cooked pasta will last for 3 to 5 days in the refrigerator. How long can cooked pasta be left at room temperature? Bacteria grow rapidly at temperatures between 40 °F and 140 °F; cooked pasta should be discarded if left out for more than 2 hours at room temperature.