Cooked vegetables will last in the refrigerator for up to 7 days before they go bad.
When storing cooked vegetables in the refrigerator make sure to store the cooked vegetables in a sealed container with a lid.
After 7 days though even when they are sealed in the refrigerator the cooked vegetables can start growing mold and if they start growing mold the vegetables should be thrown out.
If you want to keep the cooked vegetables longer than 7 days then you should place the cooked vegetables in the freezer.
Cooked vegetables will last for 6 months to a year in the freezer as the freezing temperatures in the freezer prevents bacteria and mold growth.