Gluttony is a sin against the moral virtue of temperance.
Summa, IIa IIae, Q.148, a.1, respondeo.
Temperance is one of the four Cardinal Virtues which are the main pillars of the moral life.
Gluttony is one of the seven deadly sins. From these seven sins arise the other sins.
Summa, IIa IIae, Q.148, a.6.
Gluttony is consenting to the desire to eat or drink an unreasonable amount or in any circumstances which are unreasonable.

Here is how St. Thomas Aquinas teaches this important truth:

Gluttony denotes, not any desire of eating and drinking, but an inordinate desire. Now desire is said to be inordinate through leaving the order of reason, wherein the good of moral virtue consists: and a thing is said to be a sin through being contrary to virtue.
Summa, IIa IIae, Q.148, a.1 respondeo.
Thus, e.g., if a person knows he eats too much and weighs too much, he is aware he has committed (is committing) the sin of gluttony. That is, he knows he eats more and weighs more than is reasonable. When our doctor tells us “you need to lose weight”, our doctor is telling us we are committing the sin of gluttony.
Gluttony is a mortal sin in a variety of circumstances. One example is when eating is the focus of our lives, i.e., when we “live to eat”. St. Paul refers to such gluttony when he laments people “whose god is their belly”. (Phil. 3:19.)
Another example of the mortal sin of gluttony is when a man foresees that his habit of gluttony will likely cause him serious future health problems. Such serious health problems can occur in many ways, e.g., because his excessive weight will foreseeably shorten his life, or will likely cause harm to his heart or his joints, will likely cause diabetes, etc.
Here is how St. Thomas Aquinas teaches this important truth:
The glutton intends, not the harm to his body, but the pleasure of eating: and if injury results to his body, this is accidental [i.e., aside from his intention]. Hence this does not directly affect the gravity of gluttony, the guilt of which is nevertheless aggravated, if a man incurs some bodily injury through taking too much food.
Summa, IIa IIae, Q.148, a.3, ad 3 (emphasis and bracketed words added).
There are five main ways that a person can commit the sin of gluttony:

Conclusion: Let us be on guard against all types of gluttony, arch-enemies of the spiritual life!