You can store pesto in the fridge for up to 3 days before it starts to lose flavor. Store it in glass jars and add a thin layer of olive oil on top (this will create a "seal" to keep out air, which will help slow down the oxidization process which is what makes pesto lose its color and flavor).