When someone is said to be “down in the mouth,” it means that he or she seems depressed or dispirited. Similar terms include “in the dumps,” “feeling the blues,” or “bummed out.” Many cultures have some form of expression for describing someone who is depressed, using the turn of phrase as shorthand to describe someone's state of mind.
English speakers have been using “the dumps” to refer to a depressed state since the 1500s, and the expression “down in the mouth” emerged around the mid-1600s. It's a reference to the turned down corners of a frown, as most people associate frowns with upset or unhappiness. When someone is described in this way, it literally means that his or her mouth is composed in a downturned expression, because of a general state of glumness that precludes smiling.
In addition to being used to refer to someone who is depressed, this idiom is also used to describe someone who is sick. Many people feel a bit sad when they are not feeling well because they are not operating at full capacity, and they may feel frustrated or just generally unwell. In addition, being sick often leaves people lots of time to think about issues in their lives, and this can create a feeling of depression as well.
Since many people do not like to see friends unhappy, when someone appears to be down in the mouth, his or her friends may try to take action to alleviate the situation, ranging from mediating a dispute to throwing a party. Sometimes, such efforts backfire, because people don't understand the root cause of the depression, or someone's temperament is simply not suited to whatever intervention technique is used. This is why it is common to be warned that someone is feeling down in the dumps before visiting, so that people can prepare themselves for an interaction that may not be enjoyable.
Sometimes, people simply go through a phase of being unhappy that even the most well-intentioned friends cannot help with. Depression and sadness are natural states for certain periods of people's lives, and sometimes it is better to work through them than to try and suppress them. Many people use such periods as an opportunity for introspection, and some choose to pursue therapy to talk about issues that may be troubling them.