To gloat means to feel happy and show it when someone else has a bad result. It is often seen as rude or mean because you are happy about another person's problems.
He gloated when his team won the game.
She gloated after her friend lost the race.
To gloat can also mean to look at something you did well and feel very proud. This is not always about others' failures but your own success, sometimes shown proudly.
He gloated over his good grades last year.
She gloated at her work after finishing it well.
Gloating can happen inside your mind when you feel very happy or proud about something. You may not say it out loud but feel very pleased inside.
He gloated quietly over the good news.
She gloated in her mind after winning the prize.
Gloat as a noun means the act of showing pride or pleasure, often when others have problems. This form is less common but sometimes used in writing or speech.
His gloat was obvious after the victory.
There was no gloat in her eyes despite success.