The tongue has a complex mechanism for informing the brain about contact with something hot, such as tea. The same mechanism is pretty fast and efficient. There are a multitude of nerve endings on your tongue that detect temperature. As soon as you take a sip of that hot tea, these endings are activated, alerting the brain.
Here’s how the process works, in detail.
When the temperature of the tea is higher than 109.4 degrees Fahrenheit (43 ° Celsius), a certain protein is activated in the cell membrane of the nerves mentioned above. Specifically, the activation of the protein (called TRPV1) means that it opens a channel in the cell membrane through which calcium ions will move.
The movement of calcium ions has the effect of transmitting a nerve impulse that is received by the brain as pain and heat. This way you are warned that the tea is too hot and you should stop drinking. As you have noticed, if you have ingested, hastily, a larger amount of hot tea (or other product), the burning effect on the tongue is maintained for a longer period. Interestingly, certain foods, such as hot peppers, use the cellular mechanism mentioned to activate the same sensation of heat and pain, although it has nothing to do with high temperature. It is considered that the fact that we feel like capsaicin, the chemical compound present in spicy foods, is an accident of evolution. For a detailed explanation of why hot food gives us a burning sensation, see this Youtube video.