Generally speaking, it depends on whether the verb conjugates with 'avoir' or 'etre'. Should the verb require 'etre', the past participle agrees with the gender and number, e.g. elle est sortie.There are also cases in which verbs that take 'avoir' need to be agreed with the number and gender. This occurs when the referent object of the sentence is placed before the verb. For instance, 'La farine que j'ai achetée au supermarché est de qualité supérieure.'