(written from a Production point of view)
Referenced in ultimately unused dialogue from the final draft script of TOS: "Charlie X", Charlie's law was a principal that Yeoman Janice Rand thought up and applied to Charles Evans. In Rand's words, the idea was "everybody better be nice to Charlie, or else."
In the aforementioned teleplay, Rand made an initial reference to Charlie's law after Evans desperately claimed to her, while the two were alone in Rand's quarters, that he wanted only to be "nice" to her. As a scared Rand secretly switched on an intercom to allow the bridge officers to hear her interaction with Evans, she commented, "That's a switch on Charlie's law." This angered Evans, and he demanded to know what she meant. In reply to her explaining how she defined "Charlie's law", Evans exclaimed it wasn't true.
"Charlie's Law" was also the name of a novelization of the episode "Charlie X", adapted by James Blish and published in the first Bantam Books Star Trek novelization collection in 1967. The novelization included the scene in which Rand repeatedly invokes Charlie's law. Blish's writing therein formatted the name as "Charlie's Law", despite it being "Charlie's law" in the script.