According to Eat By Date, fresh pasta lasts for four to five days in the refrigerator, and cooked pasta lasts for up to a week when refrigerated. Store fresh or cooked pasta in the freezer for up to eight months.
Placing the pasta in a container with a lid to keep out excess moisture or contaminants is the best way to refrigerate it. Placing it in a large freezer bag is another way to store pasta in the refrigerator. Be sure to store the pasta in a freezer-safe container before putting it in the freezer. While fresh pasta does not dry out when frozen, cooked pasta can dry out when it is kept in the freezer for too long.