
Pat somebody/yourself on the back
Self-Congratulation
Use it when you or someone else did something praiseworthy, to acknowledge success or good work. 
Informal Expression
It’s a casual phrase, best used in conversational or informal settings, not in formal writing. 
Figurative Speech
It’s not usually a literal action, but a metaphorical gesture meaning to feel proud. 