Humans associate teeth chattering with cold temperatures, but you won’t ever see your cat’s teeth chattering for that reason. Rather, chattering is the “frustrated hunter reflex”: the cat, a natural predator, is in a place where he spots a potential prey, but he can’t get to it, so his teeth chatter.
You may have observed this when your cat was sitting on a windowsill, looking out at a bird, lizard, mouse or other outside creature. The cat’s teeth would not chatter if the cat was outside the window, with the prey within reach.