I thanked my teacher for giving me a pass mark in the exam.
Is there a single word or short phrase for the emphasised phrase?
"Pass" is the appropriate verb:
pass — to cause or permit to complete successfully (an investigation, examination, course of study, etc.): I am passing the whole class this term.
The example usage refers to a study who is "passing" but you can assign the cause to a teacher or professor just like your example does:
I thanked my teacher for passing me on the exam.
This is typically used for classes or courses but it still works for individual passing grades. The opposite of "passing" is "failing":
I thanked my teacher for failing me on the exam.