A modifying word, phrase, or clause following a noun is set off by commas if it presents information which is not essential to identify the noun or the meaning of the sentence.
This is called a nonrestrictive modifier, i.e., it does not restrict the meaning of the noun or sentence.
Example: Any student not sitting down will get detention.
(This takes no comma because the phrase not sitting down is necessary to identify the noun. Remove it, and you get something very different: "Any student will get a detention.")
Example: Marcia Gomes, who was not sitting down, just got a detention.
(Here the person is named specifically. We know whom the sentence is about. The clause who was not sitting down does add information, but it is not necessary to identify the noun it modifies. Drop the clause and we still know who got the punishment: "Marcia Gomes just got a detention.")
Sometimes, the punctuation may depend on the situation. For example, if I have just one sister, or the reader already knows whom I am talking about, this sentence is correct:
My sister, Martha, is a nurse.
However, if I have more than one sister and it is not otherwise clear whom I am talking about, her name is essential to identify the sister.
My sister Martha is a nurse.
Or perhaps to make it clearer:
My sister Martha is a nurse; my sister Marianne is a teacher.
See also Dashes with Nonrestrictive Modifiers.