caffeine while pregnant

I'm not pregnant and I never have been before but I saw someone make a comment that someone should watch their tea intake because of the caffeine. Can that be bad for your pregnancy? Would it hurt the baby? Sorry I'd never heard of that before. Same with coffee can you not drink it either?