S & M is short for sadism and masochism. Sadism is sexual arousal or satisfaction from inflicting pain onto another person. A few examples of this are whipping, spanking, biting, scratching or using handcuffs.
Masochism is sexual arousal or satisfaction from enduring pain. This can include a variety of things, some of which are: being tortured, bound, tickled or having hot wax poured on the body. Often the two (sadism and masochism) are partnered together, where one person inflicts the pain and the other receives.