They are just sewn on—or they are applied to sewn-on Ve […]
They are just sewn on—or they are applied to sewn-on Velcro. Spacesuits are made up of many layers to collect moisture, carry away body heat, contain the air, insulate the wearer, reject solar heat, protect from micrometeorites, and protect from abrasion. Patches are hand sewn onto the outer layer.
In the old days, mission patches were sewn on, then removed and given to the astronaut as a souvenir of the flight—and replaced with new patches for subsequent use or display. Things are a little different today.
In this image, the EVA group patch is sewn permanently to the right shoulder. The flag (left shoulder) and mission patch (chest) are attached by Velcro, since ISS astronauts are not given a custom made suit.
During the Apollo program, after the Apollo fire, patches (along with most other fabric surfaces in the spacecraft) were made of beta cloth (a fabric made of glass fibers wrapped in teflon). In modern spacecraft, the operating environment is a normal, sea level atmosphere instead of the pure oxygen of Apollo, so beta cloth is no longer needed as a safeguard against fire.