Presumably used to treat mental illness
A witch wrote to Harry Potter in March 1996 after the The Quibbler published his interview concerning the murder of Cedric Diggory and the return of Lord Voldemort. She suggested that he undergo a course of Shock Spells at St. Mungo's.
Behind the scenes
The true effects of this spell is unknown, but its name suggests that it might be used to treat the acute stress reaction (i.e., shock) that can follow a terrifying experience, or that it involves subjecting the patient to a mild electrical current like Muggle shock therapy. Knowing St. Mungo's, it's probably the latter.
- Harry Potter and the Order of the Phoenix (Mentioned only)