How does the brain immediately know when one's thirst has been quenched?
There are two different aspects to or drivers of thirst, osmolality and hypovolemia, with plasma osmolality elevation being the more potent stimulus of thirst. 
As stated by @arboviral (and supported by his link), not a lot is known about the mechanisms of immediate thirst satiety. Much more is known about the mechanisms causing thirst, and the mechanisms of return to normal serum osmolality over 120-180 minutes after rehydration than those immediately satisfying it.

Most of the research on this is old (pre-2000). In one often-cited very small study 1, swallowing and esophageal reflexes (or as the authors termed it, “oropharyngeal metering”) had a significant effect on relief of thirst, that is, 


  the act of swallowing helps to regulate the volume of fluid ingested by providing an integrated signal proportional to the cumulative ingested volume.2


Study participants were all mildly dehydrated. One (control) group was allowed to drink ad lib. Another was allowed to drink ad lib but as they did so, the fluid was simultaneous extracted from the stomach by a nasogastric (ng) tube already in place. Interestingly, the difference in the amount of fluid ingested between these two groups (N.B. ad lib) was only 15% (the latter group drank a bit more.) The third group was given fluid by ng tube only.

The very act of swallowing fluid boluses induced satiety. However, plasma arginine vasopressin levels (involved in the regulation of fluid intake) dropped rapidly during the first 5 minutes of drinking in both ad lib groups, but not in those given fluids via ng tube, so it is not only mechanical receptors that are involved in quenching of thirst.

This confirmed an older study which demonstrated the importance of the rapid drop in plasma vasopressin in hydration before major changes in plasma osmolality occurred.3

Given the lack of extensive research and the relative immediacy of thirst suppression, The most likely explanation is a combination of sensory modalities and reflexes (mucosal wetness, temperature of rehydration fluid, mechanicoreceptors in the oropharynx, esophagus, etc.), and some rapid hormonal changes - e.g. in AVP - are responsible for limiting the amount we drink when thirsty.

1 Regulation of fluid intake in dehydrated humans: Role of oropharyngeal stimulation
2 Influence of age on thirst and fluid intake
3 Acute suppression of plasma vasopressin and thirst after drinking in hypernatremic humans