Wheatley suffers from this in Portal 2. After dethroning GLaDOS and taking over the facility for himself, he's slowly corrupted by the mainframe, becoming downright sadistic and lashing out in uncharacteristic rage at seemingly random intervals. This culminates in the Final Boss fight against him. He starts off rather calmly, engaging in Boss Banter and acting extremely intimidating. After bursting the Conversion Gel pipe, he gets pissed, which is when his sanity starts to slip. But it's only when you attach the first and second core to him that he really starts to lose it. He starts spouting paranoid delusions, using the fact that you didn't catch him at the beginning of the game to accuse you and GLaDOS of only pretending to be enemies to use him, and that the events of the entire game were all a ploy. But the thing that makes this so heartbreaking is the fact that while he says that, he's crying.
Wheatley:(voice breaking) Oh, it's all becoming clear to me now! Find some dupe to break you out of cryosleep! Give him a sob story about escaping to the surface! Squeeze him for information on how to find a Portal Gun! Then, when he's no more use to you, he has a little "accident"! Doesn't he?! "Falls" off his management rail?! DOESN'T HE?!
(Some of) The characters in Psychonauts whose minds you enter, but especially the ones in the asylum levels.
Fred is a particularly striking case, starting out as an asylum staff member and becoming one of the very patients they treat.
One of the nice things about this game is that you invert the process for a few characters. By helping them confront deep-buried issues and work through problems they get some of their lives back.
This is a major gameplay element in Call of Cthulhu: Dark Corners of the Earth. The "hero" is slowly going insane due to all the Eldritch Abominations running around. This results in hallucinations, talking to himself, and hearing voices. The player can reduce the rate at which he goes insane by keeping him from being exposed to disturbing situations (this being a horror story based on the works of H.P. Lovecraft, that's easier said than done). If it gets too bad, the hero may attempt suicide and prompt a Non-Standard Game Over.
Eternal Darkness has this as one of its main gameplay mechanics with a "sanity gauge" that drops whenever enemies are encountered. Once it gets low, the reallyweird shit kicks in.
Sid Meier’s Alpha Centauri: If you're really kicking the crap out of another faction and refuse to accept their surrender, they send you increasingly-crazy messages until you kill them or otherwise stop the war.
In the Paradox InteractiveReal-Time Strategy game Crusader Kings, characters can occasionally become Stressed. In itself, this only causes a slight stat hit, but if left unchecked, Stress can further worsen into Depression, Schizophrenia, or outright Insanity, and once one of those hits, that character is locked in a vicious spiral of stat decay, personality instability, and possibly even murderous sociopathy until he or she finally dies or gets "Locked Up for Good!" (which is effectively the same thing).
This shows up in Borderlands through Patricia Tannis' logs. She starts out sane (if unenthusiastic) on Pandora and the combination of the world's environment and too much time alone pushes her from "Why do I have to be here?" to idle chitchat with someone pinned and dying under a stone pillar because she knows it's the last conversation she'll have with anyone for awhile to dating, then breaking up with, her audio recorder (they're still friends though). All this occurs prior to the events of the game and by the time you meet her she's...a bit off.
She also gives a dude named Crazy Earl an artifact to safeguard, and to seal the deal, some of her underwear as well. It was her idea too. Also, Baron Flynt punched her dog.
Tannis explains in the sequel how she became a bit nutty and how the bandits came to be on Pandora. Her and several people used to work for the Dahl corporation and they were sent to Pandora to mine for minerals and do research studies. After a while, the corporation ditched everyone and left them to fend for themselves, causing many people who were normal and had decent lives to slowly grow insane and become bandits. While Tannis simply became just plain weird, she admits that what Dahl did left her and many others broken.
Tiny Tina, world's deadliest 13 year old. The reason behind her total loss of sanity? Flesh Stick (yes, that's is his name), sold her and her parents to Handsome Jack, for his Slag experimentation. Her mother gave her a grenade and taught her how to use. What next? Handsome Jack used them as guinea pigs. Seeing her parents mutate due to slag, Tiny Tina ran away after putting the grenade to a good use. Ever since, she went a bit nuts... BURN ALL THE BABIES!!!! Dummied Out audio files show Tiny Tina's descent into madness, but it was likely cut out for being a bit too disturbing since she's a pre teenager.
While Big Bad Handsome Jack started out evil (trapping your daughter in a small room for her entire life is not the action of a decent man), in Borderlands: The Pre-Sequel! and the "Get to Know Jack" sidequest in Borderlands 2, he's shown to have steadily degenerated from a reasonably controlled form of evil to the casually murderous, deeply self-obsessed version that gets pointed at the Vault Hunters in 2.
Knights of the Old Republic II: This is the entire plot arc for Atris. Before the events of the game she tried a gambit to try and lure the Sith out of hiding. It backfired horribly, killing nearly all the remaining Jedi in the galaxy. As a result the ex Jedi Council member is cooped up on a remote planet with her handmaidens desperately trying to convince herself she was in the right, and that she can till save the Jedi. Furthermore she is convinced you are the real villain no matter what you say, or do.
Over the game's length she starts to crack even more, no thanks to Kreia's influence and the Sith artefacts she has gathered, but surprisingly if you are restrained in your final meeting with her she shows signs of recovery and there's a Ray of Hope Ending for her
In a somewhat stranger example, RevanAfter three hundred years of being trapped in stasis and mind raped by the Sith Emperor, (all the while subtly influencing him NOT to attack the Republic) he's broken out by a strike team..... Only to immediately go to one of the remaining Star Forges in the galaxy (you know, the Eldritch Location he spent the better part of the first game trying to destroy?) and attempts to build a robotic army that will wipe out all those in the galaxy that contain even a trace of the Sith gene in them-incidentally 97.8% of the Imperial population. Not that, given his situation, this isn't slightly justified.
This plays out in reverse in Time Fcuk. The protagonist is a Heroic Mime, but due to the unusual nature of time and space in the game, he often gets radio messages from his past and future self. In the beginning, you're getting messages from what seem to be several future selves, ranging from a Perky Goth to a Conspiracy Theorist to someone who's flat-out hallucinating. Towards the end, you can hear his early messages, when he was The Everyman— making it scarier, now that you know exactly how he'll be broken.
This is the result of the third week of CROSS†CHANNEL, the first week where Taichi knows time is looping and has more of his deep psychological issues surface. If it wasn't for this and the broadcast he makes at the end of that week, this treatment of Kiri would be rather hypocritical and unforgivable.
Vampire: The Masquerade – Bloodlines featured a quest in which one has to "cleanse" a haunted hotel (much akin to The Shining). Upon finding the diary of a woman whose ghost now lives in the house, one can read her tale of how her husband experienced one of these inspired by romantic jealousy, culminating in him murdering her and her two children and killing himself.
Fentible of Starship Titanic suffers for these occasional, usually in mid conversation. The end result is mostly rudeness and forgetfulness. Thankfully he can be reset.
In Schizophrenzy, you play Private Investigator John K. Facey - a severe schizophrenic. Your sanity is represented by a sort of "health meter" and is constantly decreasing, with only your medication keeping you from going completely over the edge. Of course, even fully medicated you perceive yourself as walking on walls and hallucinate bizarre creatures.
In The Sims 2, if a Sim's aspiration meter is very low, they'll start doing crazy stuff related to their Aspiration:
A Romance Sim will try to dance with a mop...
A Popularity Sim will start talking to a puppet made out of a plastic cup...
A Family Sim will cuddle a flour sack with a face drawn on it like it was a real baby...
And a Fortune Sim will go out on the street and beg for money.
and when it bottoms out completely they will collapse on the ground babbling, and a therapist (who is only visible when that sim is selected) will appear and talk to them for a while, moving their aspiration meter back up one level.
Assassin's Creed had mentions of Subject 16, who committed suicide after excessively prolonged Animus sessions caused mental breakdown due to the "Bleeding Effect," where the Animus subject may gain their ancestor's abilities but end up being unable to mentally distinguish themselves from the ancestor, though Desmond only ends up gaining his ancestor Altaïr's Eagle Vision ability. In Assassin's Creed II this is deliberately invoked in an attempt to quickly train Desmond to become an Assassin, but along the way Desmond suffers visual hallucinations and experience (in his sleep) one of Altaïr's memories without being in the Animus. By Assassin's Creed: Brotherhood he's become an Animus-trained Assassin but the hallucinations have gotten more frequent, are now both visual and auditory (sight and sound) and may not even be from his ancestor Ezio's memories. On at least two occasions Desmond inadvertently refers to himself in the first-person when describing Ezio's actions, and later in the game an e-mail reveals that the other modern-day Assassins have heard Desmond screaming in his sleep.
The Shadow Hearts games, along with the usual HP and MP gauges, also feature a Sanity Gauge, as the characters are constantly fighting horrific and twisted abominations. If the Sanity of any character slips below zero, the background music changes and the character goes berserk, attacking everything around them.
Sergeant Michael Becket of F.E.A.R. 2. A combination of Alma's Mind Rape powers, her actually raping him, and being held captive by Armacham for nine months while being continuously tested and experimented on has driven him gradually insane by the time F.3.A.R. rolls around.
Shin Megami Tensei: Devil Survivor has an odd example of an AI apparently undergoing this. The Laplace Mail starts out giving news from the future, but as the game wears on (and the protagonists repeatedly prevent its predictions from coming true), it starts to get glitchier and glitchier, first capitalizing random letters and eventually adding in weird symbols in place of them, changing its "Have a nice day" ending to "Have a nice death", and finally spitting out an error message and discontinuing all together.
Pit of all people starts to go crazy in Kid Icarus: Uprising. In chapter 23, he gets eaten by Hades after the 3 Sacred Treasures are destroyed in front of him. When he's eaten, he's isolated from the outside world and can't get into contact with Palutena. Only Hades can talk to him from the inside and constantly taunts him the whole dungeon. It gets to the point where Pit starts talking to himself and acting like he's going crazy. Then there's chapters 18-21.
Martin Walker, the main character of Spec Ops: The Line spends most of the game slowly going crazy trying to justify what he did during the white phosphorous incident to the point of imagining entire conversations with the dead villain to somehow make it so that he was forced into his actions. The language he uses also gradually devolves from professional military expressions, to loud, insane Battle Cries consisting mostly of angry rambling and cursing of his enemies.
The title character of Iji can experience this, depending on player actions/inactions. She becomes increasingly desperate and maniacal if her body count increases rapidly (going from crying "I'm sorry!" to those she kills to shouting "DIE!"). She also swiftly goes completely unhinged if Dan is killed, even the final boss shows sympathy for her state.
Matthew Baker from Brothers in Arms follows this trope as the stress from losing squadmates and friends begins to pile up.
In BioShock anyone who is hooked on ADAM will slowly loses their sanity, as it destroys and rebuilds their physical and mental state. The best example is Dr. Steinman, in his audio diaries he becomes increasingly delusional, beleving he's talking to the Greek goddess Aphrodite, and spends most of his time doing surgery on other splicers to create his version of what is beautiful.
Steinman: An intruder?! He's ugly! Ugly! Ugly! UGLYYYYYYYY!
In Don't Starve, your character has a Sanity Meter that slowly goes down if you neglect it. If it gets low enough, you start seeing flickering visions of shadowy monsters. Let it drop even lower, and various crazy things happen: the wild rabbits roaming the land become replaced with monsters made of hair called Beardlings, shadowy hands might reach out to snuff out your campfire at night as an Ominous Music Box Tune plays, and the shadowy monsters you see become more and more real until they come to life and try to kill you.
Salvatore Leone from Grand Theft Auto comes off as a friendly, if ruthless man in Grand Theft Auto III, only to try and have Claude killed because he suddenly becomes convinced Claude's a spy. Liberty City Stories shows that he had fits of extreme paranoia before this, one time nearly blowing Tony's head off while accusing him of scheming behind his back. Grand Theft Auto: San Andreas reveals that this extreme paranoia was caused by CJ playing him (and pretty much every other faction that was involved) for a fool in the game's bank heist arc.
Happens to Eddie in Silent Hill 2. He starts off as a scared yet lazy kid, but later on he kills a couple of men and threatens to kill James. In truth, he's been crazy all along, just like James.
All three of the main characters in Ib can experience this. While Ib is on the outside the calmest of the trio, she doesn't really handle the gallery well. She hallucinates constantly, seeing bunnies when she looks at dolls, seeing images of herself hanged, etc. Mary displays a bit of neediness from the get-go. It turns out she is already unhinged, and can become even more so depending on how her companions interact with her and the gallery in general. Garry is probably the sanest of the three and only starts slipping mentally if the player lets him. If Garry fails the doll room event, he gets brainwashed by the dolls. Generally a good slap on the face is all it takes to bring him back, but if he's been kicking over a lot of artworks before that point, the damage to his mind is permanent.
The protagonist of The Consuming Shadow is already doubting from the beginning of the game if anything he experiences is real. It only gets worse from there as he sets out to fight Eldritch Abominations and other horrors.
Double subverted with Zant from The Legend of Zelda: Twilight Princess is normally calm and collected, but this is merely a facade, as he's actually completely nuts. During his boss battle, he reveals his true colors, but becomes even more insane as the battle goes on, until he goes apeshit and is reduced to a screaming, maniacal wreck.
The Harran virus in Dying Light first causes seizures, then increasingly vivid hallucinations that rapidly take on a terrifying tone if the uninfected are unable to get their supply of Antizin on time. If it's allowed to progress past that, zombification is the inevitable (and irreversible) result.
Over the course of the Batman: Arkham games, the Riddler gets hit with this pretty hard. With every game he tries harder to defeat you, and with every game he fails, cracking his fragile ego further and further until, by Arkham Knight, he's more ranting and aggressive than ever before.
In Batman: Arkham Asylum, Scarecrow is insane, but not much moreso than any other of Batman's rogues. After getting mauled and nearly killed by Killer Croc, he completely loses it and in Batman: Arkham Knight becomes arguably the biggest threat that Batman faces in the entire series.
The Sleepers, otherwise normal people who've been influenced by DagothUr'sPsychic Dreams start out babbling about Dagoth's return and the rise of the Sixth House. After a certain point in the main quest, they will turn hostile and start attacking the player.
Dagoth Ur and the Tribunal all suffer from sanity slippage to varying degrees as a side-effect of becoming Gods through the power of the Heart of Lorkhan. Dagoth Ur has it the worst, since he was far less restrained in his consumption of the heart's power. Of the Tribunal, only Almalexia exhibits any obvious signs of insanity, though it is implied that Vivec and Sotha Sil would have eventually suffered the same fate.