caution: spoilers for Harry Potter and the Prisoner of Azkaban follow
In J.K. Rowling's Harry Potter series, Moony is the nickname of Professor Remus Lupin, the Defense Against the Dark Arts teacher in book 3. This became his nickname because whenever there is a full moon, Lupin transforms into a wolf, as he is a werewolf. This is a result of a werewolf bite he got when he was a small boy.
When he was a student at Hogwarts, Lupin was friends with Harry's father James, as well as Sirius Black and Peter Pettigrew. All four were unregistered Animagi; James, Sirius, and Peter became Animagi so that they could help their friend Moony out when he transformed. When he became a wolf, he was dangerous to others, so they would transform at the same time and keep him from causing any trouble.
To facilitate this, Headmaster Albus Dumbledore had a tunnel built from Hogwarts grounds to a run-down old house a little ways away from the rest of civilization, called the Shrieking Shack. Whenever there was a full moon, Lupin would travel through this tunnel to the Shrieking Shack, along with his three friends, and stay there until he transformed back. To prevent other students from finding the tunnel, Dumbledore had a tree installed over top of the opening, the Whomping Willow, which would flail its heavy branches at any one who got too close to it.
When Lupin was hired as a teacher by Dumbledore, he regularly took the newly-discovered Wolfsbane potion, concocted by Professor Snape under Dumbledore's instructions, to stave off his monthly transformations. When he forgets to take it in his rush to help Harry, Hermione, Ron, Snape, and Sirius at the end of book 3, he transforms; even though Hermione had just exposed him as a werewolf, no one had expected him to transform, and hysteria ensues, giving Peter Pettigrew the opportunity to escape. After the entire encounter involving the seven of them comes to as much of a resolution as can be expected, Lupin decides to resign when Snape reveals his werewolf status to the public, and this is the last we see of him.
for a more complete account of the incident alluded to here at the end of book 3, see Sirius Black. for more on Moony, see Professor Remus Lupin.