People often misinterpret the First Amendment of the U.S. Constitution to mean that they have freedom of speech in all aspects of their lives. The First Amendment prohibits people from facing arrest (with some exceptions, of course) for voicing their opinions. However, it doesn't prohibit private employers from taking disciplinary action (including termination) against employees for saying things that others may rightfully find offensive or that involve protected or confidential information.
Employers have some legal restrictions in taking action against employees for matters involving speech. For example, if disciplining or firing someone for something they say or discuss could be considered discrimination against them for their race, religion or other characteristic protected by the law, that could be prohibited. Taking disciplinary action against an employee for speaking a language other than English during their lunch or rest breaks could be a problem.
Whistleblower protections could come into play. An employee who speaks out when they believe that something illegal is being done in the workplace could be protected under whistleblower laws.
Employees should exercise caution when speaking out about things that could be considered offensive or confidential. For example, depending on what kind of business you're in, some people may have higher level security clearances than others and may be prohibited from sharing information that others aren't authorized to have. You may have signed a nondisclosure agreement that prohibits sharing certain information.
Unhappy employees can get themselves in trouble when they aren't careful about their speech. It's one thing to complain about working conditions, but quite another to say that your boss is an unqualified dolt. If you bring their gender, ethnicity or sexual orientation into the mix, your speech could be considered discriminatory.
Businesses are wise to have clear policies in place that outline what type of speech is and isn't allowed. Employees should follow those and, when in doubt, use some common sense. Aside from avoiding disciplinary action, being careful with your speech can make life at work more pleasant for everyone. Sharing your political views may not get you fired, but it could impact your ability to work effectively with your colleagues.
If you believe you were wrongly terminated or retaliated against for something you said in the workplace, it may be wise to consult with an attorney to determine whether or not you have a case.