Restrictive vs. Nonrestrictive
If the adjectival clause or phrase is nonrestrictive, put commas around it. If the clause or phrase is restrictive, do not put commas around it. See the discussion of that vs. which in chapter 4 of the eBook Developing a Powerful Writing Style, "Word War IV: Clauses vs. Phrases."
Here's a quick review:
A nonrestrictive clause or phrase does not identify or single out the noun modified. From context, the reader knows the noun modified and does not need the information in the clause or phrase to define "which one." A nonrestrictive clause is introduced by the word which (or who, whom, or whose, if appropriate). You must use commas to set off the nonrestrictive clause or phrase.
A restrictive clause or phrase identifies or singles out the noun modified. From context, the reader does not know "which one" and needs the information in the clause or phrase to identify "which one." When you use a restrictive clause or phrase, there must be others (persons, places, or things named by the noun) from which you can single this one out. Use that (or who, whom, or whose, if appropriate) to introduce restrictive clauses. No commas should appear with a restrictive clause or phrase.
Perhaps examples will illustrate the distinction:
The report that the agency submitted was well researched.
(Restrictive. Identifies which report among all other reports. No commas.)
The report, which the agency submitted, was well researched.
(Nonrestrictive. From context the reader already knows which report because you've been talking about it or because necessarily there's only one report. Use commas.)
The judge sitting next to the clerk leaned over to ask a question.
(Restrictive. Identifies which judge among the other judges that necessarily exist in the context. Perhaps it's a three-judge panel. No commas.)
The judge, sitting next to the clerk, leaned over to ask a question.
(Nonrestrictive. The reader already knows which judge, or from context there is only one judge. Use commas.)