Teeth are a part of Transformer anatomy sometimes found inside the mouth, surrounding the tongue. Though Transformer teeth seem similar in structure and appearance to the teeth of humans, what function they serve on Transformers can be a subject of debate.
Humans use teeth primarily for breaking down the foods they consume into digestible portions, but Transformers fuel is mostly, if not entirely, liquid. Human teeth are also used to help form certain sounds in their language, in conjunction with the tongue. Transformers are capable of human speech, and sometimes are shown to have both teeth and a tongue, so it's possible their teeth may be used for communication. Two functions of teeth definitely shared between humans and Transformers are using them as a weapon and baring them to indicate hostility.
Transformers who have animal-based alternate modes tend to have teeth in those adopted forms. Most of these alt modes were acquired after contact with other planets such as Earth, so the inclusion of teeth in Transformer anatomy is often irrelevant to understanding why some Transformers have them. However, eons of conflict have taught the Transformers to take advantage of whatever weapons one can find, and some have taken quite a liking to teeth.