Modesty

Modesty is what people do to avoid attracting attention to themselves. Often modesty is about avoiding sexual attraction. Modesty is related to moderation, not bragging or showing off. Modesty and humility may seem similar, but are not the same. Because modesty is on the surface, it may be false. Humility is behavior that comes from truly thinking no person is better than any other. 
Clothing has many functions with regard to modesty. Clothing is the usual way to avoiding sexuality when it would be inappropriate. Modest clothing communicates the wearer's social status without overdoing. Conformity to a dress code such as businesswear signals group membership over individuality.
Cultural differences.
The major cultural differences in modesty are about privacy and gender. Modesty is a part of social relationships, and may not apply when alone or with intimate relations. Modesty is about sexuality, which historically had different norms within single-sex groups, but is changing with the definition of sex and gender. 
Religion determines what many people believe about modesty. Modesty is required in many cultures, based upon the beliefs of Abrahamic religions that see the human body as shameful. Orthodox Judaism and Islam require believers to wear clothing that covers all of the body that is sexual. For women, this includes the entire body except hands and faces, including the hair. Anabaptist Christian groups continue to observe purely functional "plain dress". These include the Amish and Mennonites in the United States. Less strict, but conservative religious groups also adopt clothing and behavior more modest than what is acceptable by the majority.
Indigenous peoples in warm climates, having less need for clothing, developed cultures with no concept of bodily shame. In everyday life, not covering the body more than needed is normal not immodest. This may include being naked. This lack of clothing was seen as immoral by colonial explorers, and continues to be misunderstood. Western clothing is worn worldwide with adaptations for local cultures. Clothing that reveals the body continues to be worn in rural areas and on special occasions to maintain indigenous traditions.
Artistic performances and celebrations are intended to attract attention. Every society has norms that recognize that different rules apply to performers.
Privacy.
Private situations are generally limited to people who know each other well, such as life partners, spouses, family members, or close friends. There are some places that are semi-private, which include those less well-known, such as acquaintances and co-workers. Situations may also be semi-public, including others not known but limited to those with a shared characteristic, such as age or gender. Public places are open to all. Some social roles allow exceptions to rules of privacy, such as when receiving medial examination or treatment.
Gender differences.
There is little information regarding the equality of the sexes in prehistory, but some indication of the differences from one group to another. Based upon the burial method and the artifacts placed in graves, in some tribes both men and women had high position, in others only men. The same pattern is found in modern-day foraging societies. The status of women today also varies, with more gender equality in Scandinavia than other parts of the world. Inequality is greatest in Islamic countries. 
In Western cultures until this century it was not unusual for boys to be naked in public while girls would be clothed. Women are generally expected to be more modest than men. In single-sex situations, men would be naked when necessary, and it was though of as unmanly not to do so. Men and boys swam naked in YMCA and public school indoor pools until they became mixed-gender in the 1960s.
Islamic countries have few places for nudity outside the home communal bathing at the steam bath (hammam) which is for men and avoids complete nudity, a waist wrap being worn. In countries lacking baths in the home, public baths for women only may exist.
Openness regarding homosexuality has led to stricter levels of modesty in same-sex situations, such as in changing-rooms. In several places, community showers have been changes to allow privacy. Many students no longer shower after exercise. In addition, cell-phone cameras have changed the assumption of privacy in shared spaces.
Swimsuits are an indication of changes in standards of modesty. Before the 1930s, men were generally prohibited from baring their chests where women were present. For years, loose swim trunks were typical, but after the 1960s, form-fitting ("Speedo") suits were popular, and remain so in Europe. The United States has generally reverted to baggy, oversize swimwear that show less of the body. 
Women in Western societies were often not allowed to appear in public other than fully clothed until the 1920s. Women's bathing suits have steadily exposed more, with the bikini becoming typical for the young, suits that cover the torso for the more modest. In the 1960s a bikini bottom alone became popular in Europe, but has declined as women become aware of internet voyeurism. Organizations advocate for women to be allowed to have the same rights to bare their chests as men. A group intentionally violated the law in New York state not only to overturn the law but make it unconstitutional. In 1992, the state's highest court ruled that New York's law did not apply when there was no sexual intent, as in sunbathing. However, the argument for equal rights under the Constitution was rejected.
Historically, the female breast was not part of the body needing to be hidden, breastfeeding being a necessary and natural function for nurturing children. The assumption that breastfeeding must always be done in private is a recent change in societies where it has become rare. In societies where breastfeeding remains the norm, not covering the breasts in other situations is more common. In some societies, breastfeeding in public has been made a legal right, but mothers may be reluctant to do so because other people may object.
Western norms.
What is called Western culture expects that sexual body parts are covered in public places at all times. There are exceptions for places where people change clothes, as there is one changing-room for men, and another for women. Other exceptions include saunas, which are often mixed-sex places, a towel being sufficient to maintain modesty. 
Special rules also apply in places for swimming or sunbathing. These include not only beaches, but parks, some of which are in cities. Typical swimsuits would not be appropriate anywhere else. 
In many European countries, women may be topless while sunbathing, and some places are designated "clothing optional", complete nudity being allowed.
States of undress among close family members in the home is determined individually. Young children up to the age of five or six may want to be naked, and parents may allow this, even when others are present. Children naturally become modest with the approach of puberty. Some parents are also naked while bathing small children.
The quick and effective way to remove chemical or biological threats is to have victims take their cloths off and be sprayed with water. Disaster planners find it difficult to make such rules, finding many would rather be dead than naked in public.
Naturism.
Naturists (or nudists) see nudity as the natural state of humans for many activities. Nudity is seen as beneficial to both physical and mental health. Modesty is maintained by behavior which avoid sexuality while naked. Western religious views reject the idea that nudity can ever be non-sexual. Naturism is practiced in resorts and campgrounds worldwide, but is a normal part of everyday life in Scandinavia and Germany.
Religion.
Only the Abrahamic religions (Judaism, Christianity, and Islam) associate nakedness with sexual sin. In ancient civilizations, nakedness might be embarrassing as a sign of low status but not shameful regarding sexuality. Nudity was also not associated with sexuality due to fishermen, herders, and other laborers being naked while working.
Currently, moderate members of these religions adopt versions of local dress that satisfy their beliefs regarding modestly. Orthodox or conservative members often continue to wear traditional clothing. In countries where they are the majority, Islamic rules of modesty have the force of law.
Judaism.
In Orthodox Jewish Law (Halakha) women are responsible for maintaining the virtue of modesty (Tzniut) by covering their bodies, including their hair. For Jewish men, nakedness was limited to exposure of the penis. In everyday activity male nudity might be necessary, but is to be avoided. Female nudity was not an offense against God, but only about arousing the sexual passions of men.
Christianity.
The Christian standards of modesty are mainly about women avoiding tempting men into sexual sin. Pope Pius XII stated in 1940 that women should cover their upper arms and shoulders, that their skirts should cover at least as far as the knee, and the neckline should not reveal anything. Mary A. Kassian, professor of women’s studies at The Southern Baptist Theological Seminary, writes about the unfairness of placing the responsibility for resisting temptation upon women. She notes that standards of behavior vary from church to church. Citing scripture, she finds that modesty is about reverence, not just clothing, and finds nothing in the bible about skirt length or particular parts of the body being covered. American sex education often teaches young people that the human body is shameful.
Islam.
Islamic society thinks modesty is important, but there are different interpretations of what dress should be considered modest. Many Muslim women wear a headscarf (hijab) as a sign of modesty. More conservative societies expect that women cover their whole body, except for their hands and their face.
A woman who choses to also cover her face and hands is said to be expressing greater "modesty and holiness". In some Islamic societies, women wear the niqab, an all-encompassing garment intended to conceal every part of the body, sometimes including the eyes. Wearing a niqab (sometimes referred to as a burqa, although this term only technically applies to an Afghan all-in-one garment) is common in some countries with a majority Muslim population.
More conservative countries such as Afghanistan or Iran do have laws that say what kind of dress a woman should wear. Not obeying these laws can lead to harsh punishments.
Likewise, according to some Islamic interpretations of Hadith, men are required to cover everything from 'navel to knee'. Some men choosing to extend this to the traditional Islamic head covering taqiyah (cap), the male counterpart to hijab which closely resembles the Jewish yarmulke but is slightly larger in size. The taqiyah cap may vary in shape, size or color just as the hijab does, with many regional differences according to tradition and personal taste.
A burqini is a swimsuit designed for Muslim women that covers the whole body except the face, the hands and the feet, that enables them to satisfy the requirements of Muslim standards of modesty while enabling them to take part in swimming activities. This is accepted by moderate Muslims, but are not allowed by conservative Islam which requires women's cloths to be loose, with no indication of the shape of the female body.
Buddhism.
In Buddhism, modesty is the quality of being unpretentious about one's actions. Genuinely modest people are able to see themselves as they really are and rejoice in their good qualities without becoming vain and acknowledge their faults without shame.
Behavior outside the norm.
When modesty is taken beyond what is normal, it is called prudishness. Gymnophobia is a fear of being naked where it is normal, such as a shower room in school. Exhibitionism is the act or urge to expose the genitals to strangers, a mental disorder that affects 2-4 percent of men. Other public exposure of the body, such as streaking, are not exhibitionism but an alternative social norm for celebration or protest.