Self-gratification is the act of pleasing oneself. Self-gratification satisfies someone’s own needs, wants, or impulses.
The term is often used as a synonym for masturbation. When used this way, Self-gratification refers to satisfying one’s own sexual needs. Self-stimulation and self-sex are also synonyms for self-gratification in a sexual context.