Bacteria can grow in tea.
When tea sets out at room temperature for too long it goes sour.
The sour tea is growing bacteria which is making it sour and if you have soured tea then it should be dumped out.
If you do happen to drink a bit of sour tea then you will likely be fine although you may get an upset stomach.
Tea leaves may be contaminated with coliform bacteria.
If iced tea is brewed at inadequate temperatures or in an improperly cleaned urn, or if it is stored for too long, it may grow coliform bacteria, most frequently Klebsiella and Enterobacter, and less commonly E. coli.
Tea that has been sitting around for way too long is also referred to as overnight tea as well.
When tea sits around for too long, a substance called TP (tea polyphenol) that it contains will start to oxidise, this darkens the tea.
In most cases, old tea will simply be less flavorful than it should be, and taste dull or stale.
While old tea isn't usually dangerous to consume, it's definitely a less than ideal tea drinking experience.
If your tea tastes like it's gone bad or if you spot visible mold or other signs of decomposition, steer clear.
Brewed tea will slowly lose its complexity of flavor if left at room temperature for more than a few hours.
The tea will eventually sour if left for more that 12 hours. It varies a lot among tea types, some will be fine for at 24 hours.