1853 in the literal sense (witch-hunting is from 1630s), from witch (n.) + hunt (n.). The extended sense is attested from 1919, American English, later re-popularized in reaction to Cold War anti-Communism.
Senator [Lee S.] Overman. What do you mean by witch hunt?
Mr. [Raymond] Robins. I mean this, Senator. You are familiar with the old witch-hunt attitude, that when people get frightened at things and see bogies, then they get out witch proclamations, and mob action and all kinds of hysteria takes place. ["Bolshevik Propaganda," U.S. Senate subcommittee hearings, 1919]
1540s, probably from Old English wice "Applied generally or vaguely to various trees having pliant branches" [OED], from wican "to bend" (from PIE root *weik- (2) "to bend, to wind") + hæsel, used for any bush of the pine family (see hazel (n.)). The North American bush, from which a soothing lotion is made, was so called from 1670s. This is the source of the verb witch in dowsing.