Cold / cooked pasta safe to eat?
According to Still Tasty, a site that utilizes FDA, CDC and USDA data, cooked pasta should be fine for 3-5 days in the refrigerator. 

Use a shallow container or a Ziplock bag to store the pasta, and get it in the fridge within 2 hours of cooking. To keep it from sticking, toss it with a bit of oil. You can reheat it or eat it cold. 

You can freeze pasta too, which Still Tasty claims will maintain quality for 1-2 months. Pasta with sauce is somewhat better for freezing than plain. As always, freezing for longer may affect quality, but not safety. Food that is continually kept frozen at normal freezer temperatures will stay safe indefinitely.