In all my days I have never had to look behind me before saying anything (Shabbos 118b).
Lashon hara (gossip or slander) is not necessarily untruthful. The Torah forbids saying something derogatory about a person even if it is completely true.
One of the best guidelines to decide what you should or should not say is to ask: "Does it make a difference who might overhear it?" If it is something that you would rather someone not overhear, it is best left unsaid.
Sometimes the information need not be derogatory. A secret may not be saying anything bad about anyone, but if someone has entrusted you with confidential information, and you have this tremendous urge to share the privileged communication with someone else, you should ask yourself: "Would I reveal this if the person who trusted me with this information were present?"
Sometimes people want to boast. They may even fabricate their story to those who have no way of knowing that it may not be true. Still, they would be ashamed to boast in the presence of someone who knew that their statement was false.
Volumes have been written about what is proper speech and about what constitutes an abuse of this unique capacity to verbalize with which man was endowed. But even if one does not have time to master all of the scholarly works on the subject, a reliable rule of thumb is to ask, "Do I need to look behind me before I say it?" If the answer is yes, do not say it.