Gum contouring is considered a cosmetic procedure. Most of the time it's not medically necessary. Most people have their gums reshaped to improve their smile. But some get gum contouring surgery as part of other necessary periodontal procedures, such as crown lengthening, pocket reduction, and regenerative procedures.
Adding gum tissue where the gums have pulled back from the tooth and trimming overgrown tissue that has covered part of the tooth crown isn't considered cosmetic.