Farming in the original sense of the word means to do nothing but killing a certain type of monster for the express purpose of getting them to drop certain items.
"I farmed the murlocs on the coast for Slimy Murloc Scales for an hour last night."
It is common for tailors to kill lots of cloth-dropping humanoids to get cloth or for leatherworkers to farm beasts for leather. Players may also repeatedly kill certain elite mobs in instances known to drop good items.
Many quests involve farming, for example, killing kobolds in order to get their candles. Building reputation with certain factions also usually involves farming certain mobs. Timbermaw Hold, Argent Dawn, and Cenarion Circle are good examples.
A secondary meaning of the term is "collecting any crafting material" (e.g. herbs or ore). Although this activity does not necessarily involve fighting mobs, many players feel that it's similarly repetitive and uneventful as farming mobs.
Some players use the expression "farming the auction house" jokingly, meaning one of two things — either they buy needed items (instead of really farming them) or they earn gold in the AH (by buying low and selling high).