“Farming” simply means repetitively playing game content for the drops or end rewards. That could be running dungeons, doing events, killing one or more types of mobs in the world over and over again, etc.
Although generally one thinks of this type of gameplay as being performed for long stretches at a time, it doesn’t really matter if you do it in periods of 20 minutes or 20 hours. The purpose and the end result are the same: you hammer on some aspect of the game repetitively because you need something that is obtained in that way.
Thus there is no logical, realistic, or meaningful definition of the term that is compatible with your characterization of the act or the players engaged in it. There are, however, several game goals compatible with the act of farming, by design.In simpler terms, it doesn’t matter if it takes me 2 weeks or 2 years to get what I need. In both cases I am “farming” because that is how these particular goals are reached.