Griefing is the term used to describe the actions of one player deliberately hassling or attempting to hassle another player. Griefing can take many forms, from something as simple as trying to obscure someone else's view while flagged to get the target to accidentally flag or as bad as pulling mobs onto someone. One of the most obviosu and annoying forms of griefing in PvE play is the act of preventing someone from achieving their goals by doing things such as killing quest-givers.
From a PvP standpoint, opposing factions have been known to grief the other side by killing Quest NPCs, kill flight masters and innkeepers to prevent players from completing tasks or otherwise enjoying their game and using the excuse of "PvP" to justify the behavior. It also means to kill that player over and over and not allow them to get back to full health and defend themselves effectively.
Now, in World of Warcraft, a griefer is almost always one who "corpse camps", "graveyard camps" or deliberately training mobs to other characters, but the term usually includes any activity specifically designed to hamper another player's gameplay, progress, or fun. The act of training mobs is more difficult in WoW nowdays but it can still be done by ingenious players. This can also be extended to the actions of tradeskills, where a griefer may run up and attempt to skin mobs a player has killed and looted but not skinned themself yet or running up and taking an ore node a player is obviously either standing on or working on and gets attacked.