Originally taken from the roleplaying game Call of Cthulhu. In this game you'd play as mortals trying to retain their sanity in the face of Lovecraftian horrors from Beyond. More recently however, the term has been used more casually to describe sanity in all its aspects. Almost always written entirely in capital letters, as it was on some of the character sheets for the game.
Person 1: "Did you see the first Dungeons and Dragons movie?"
Person 2: "Yes, unfortunately. It wasn't a horror, but I swear I lost SAN."