Pesto freezes incredibly well, so if you want to make a big batch and be sure it lasts, I recommend freezing.  Otherwise, it will stay fresh in the fridge for up to 3 days.