Sometimes two people will rub their bodies together, with their clothes on, for sexual stimulation. Some people call this "dry sex" or "dry humping." It's a form of sex play known as outercourse, which is sex play without intercourse. Dry sex is considered a safer sex activity because no body fluids are exchanged between partners.
Sometimes people have intercourse keeping some or all of their clothes on. At different times and places in history, social custom required that women and men avoid seeing one another without clothing even during sex, even if they were married. This was true for example, in ancient Rome, in medieval China and Japan, and in some late 19th and early 20th century cultures in Europe and the U.S.