Hi qwerty12321,
Sort of.
A pronoun like "which" must agree with its antecedent (the noun or pronoun preceding it) in three ways:
Person - the quality of being.
Number - the quality that distinguishes between singular and plural.
Gender - the quality that distinguishes between masculine or feminine.
While there may be some irregular English sentence constructions which do not follow the rules, in general you're safe to follow the rules (particularly on the GMAT).
However, not all the words in your question are pronouns. For example, "where," which is usually an adverb or a noun, and sometimes is used as a conjunction, believe it or not. Same for "when."
I hope this helps!