I think the number one time when it is good to refrain from speaking your mind is when you are extremely emotional about something. This does not mean that you should never say what you want to say, but sometimes it is best to wait until emotions, tensions, etc. have lessened and you can be more tactful in your words.
I have seen countless people get upset and say things that they later regret.
If you still feel strongly about something I advise composing what you want to say in writing first. This will help you engage your higher brain thinking and come up with a good message. You could also have someone else that you trust read it and give feedback before sending it.