Electroshock or electroconvulsive therapy (ECT) is an early psychotherapy popular in the first half of the 20th century. Although at the time it was liberally applied anyone with a psychiatric diagnosis, today it is far less common; being only used in severe depression and dissociative states (for which it is very effective and often the only therapy to be so). A patient is anaesthetised and whilst they are unconscious a generalized seizure is induced.
In Words and Deeds, House suggests using it on a patient with Broken Heart Syndrome to remove his memories of the one he loved. However, this is more suggestive of transcranial direct-current stimulation (tDCS) as ECT does not target specific areas such as memory, it would also explain the repeated regime and setup of the device used in the episode. The memory loss could be referring to the reported side effects of ECT, however the memory loss is transient and difficult to target around say, memories of friends and family.