Gaslighting is deliberately trying to drive someone mad by altering their environment without their knowledge, then denying it. In a more general sense, it's denying someone's perceptions of reality in order to cause confusion, anguish, and paranoia. You move their things, transmit noises into their room when no one else is there, change little details about your dress behind their back, and so on. Or you start acting drastically differently than you usually do. When they confront you about it, you claim to have no idea what they’re talking about and feign concern for their memory and mental health. Soon, they are convinced that they're hearing voices, seeing dead people, hallucinating, or whatever. The victim can become so convinced that they're going insane that they actually go insane.
The name comes from the 1938 play Gaslight (later adapted into two separate films of the same name), where a woman's abusive husband tries to manipulate her into believing she is going insane. Her husband inadvertently dims the gas lights of their home, but assures his wife she is simply imagining it and makes her believe she is going mad.
In real life, this is a common tactic employed by the abuser in abusive relationships, especially those that revolve around an imbalanced power dynamic, including domestic abuse and school/workplace bullying. The goal for the abuser is to trick the victim into doubting their own sound judgement and perception at every turn, which usually serves a two-folded purpose. Firstly to make the victim susceptible to the idea that if the abuser commits a violent or other criminal/transgressional act on them, it didn't actually happen, just like the other things the abuser denied happened. Secondly, if the victim can be persuaded that they are not of sound mind and only the abuser is capable of seeing the truth, they can be fooled into depending on the abuser to tell them what's real and what's not, keeping them in proximity for the abuser to commit more abusive acts against them. In short, the abuser is able to both cover their crimes and gain the victim's captive loyalty by telling them a convincing lie enough times that their word becomes "the truth".
As in fiction, this method of manipulation often leaves deep psychological scars that require extensive efforts to correct, including therapy and in some cases, even medication. The abuse victims suffer, and the destabilisation of their psyche often plays a role in later manifestations of mental illnesses such as complex post-traumatic stress disorder (C-PTSD).
"Gaslighting" has undergone a certain amount of lexical devaluation. Rather than meaning "subtly influencing another's perception of reality to cause self-doubt," it is also often used to refer to subtle deception in general, or even simply meaning "to lie." At worst, one party in a conflict recalls events differently and accuses the other of "gaslighting" them even if no such malice is intended.
See also Why Did You Make Me Hit You?, Driven to Madness, Paranoia Gambit, and 2 + Torture = 5.