This is called Bruxism
This is a condition in which someone unconsciously and excessively grinds their teeth or clenches their jaw.
People sometimes grind their teeth without it causing any symptoms or problems. It’s often a response to stress. Between 22 and 31 percent of people do this during the day. Another 12 percent do it in their sleep.
Many people clench their jaw or grind their teeth with no problems. But for those with bruxism, the condition can cause headaches or even tooth damage.