When you "put your foot in your mouth" it means you say something stupid that offends another person. This usually happens when a group gathers together and you aren't aware of all the people present, or just when you speak quickly and without regard to what you are saying. You might be embarrassed when this happens, or you might embarrass someone else.
Most everyone has put their foot in their mouth at one time or another. Often, this is done without malice, but sometimes people do disregard other people's feelings. It's important to be aware of your surroundings before you talk, which can help prevent you from making a conversational blunder.
More on Social Grace and Putting Your Foot in Your Mouth:
"Jon tries to say the right thing, but ends up putting his foot in his mouth more often than not."
"Sally really stuck her foot in it. She said she hated the taste of pickles when she met the president of the pickle factory."