A letter on its own means turn that face a quarter turn clockwise, as if you were looking straight at it. An apostrophe (R') means counter-clockwise. A 2 (R2) means a half turn, and direction doesn't matter.
Lower-case letters (r, also written Rw) turn two layers together. M, E and S turn only a middle slice. x, y and z rotate the whole cube.