1937, coined in the fantasy tales of J.R.R. Tolkien (1892-1973).
The word also turns up in a very long list of folkloric supernatural creatures in the writings of Michael Aislabie Denham (d. 1859) as an aside to his explanation that those born on Christmas Eve cannot see spirits. Denham was an early folklorist who concentrated on Northumberland, Durham, Westmoreland, Cumberland, the Isle of Man, and Scotland. This was printed in volume 2 of "The Denham Tracts" [ed. James Hardy, London: Folklore Society, 1895], a compilation of Denham's scattered publications.
What a happiness this must have been seventy or eighty years ago and upwards, to those chosen few who had the good luck to be born on the eve of this festival of all festivals; when the whole earth was so overrun with ghosts, boggles, bloody-bones, spirits, demons, ignis fatui, brownies, bugbears, black dogs, specters, shellycoats, scarecrows, witches, wizards, barguests, Robin-Goodfellows, hags, night-bats, scrags, breaknecks, fantasms, hobgoblins, hobhoulards, boggy-boes, dobbies, hob-thrusts, fetches, kelpies, warlocks, mock-beggars, mum-pokers, Jemmy-burties, urchins, satyrs, pans, fauns, sirens, tritons, centaurs, calcars, nymphs, imps, incubuses, spoorns, men-in-the-oak, hell-wains, fire-drakes, kit-a-can-sticks, Tom-tumblers, melch-dicks, larrs, kitty-witches, hobby-lanthorns, Dick-a-Tuesdays, Elf-fires, Gyl-burnt-tales, knockers, elves, rawheads, Meg-with-the-wads, old-shocks, ouphs, pad-foots, pixies, pictrees, giants, dwarfs, Tom-pokers, tutgots, snapdragons, sprets, spunks, conjurers, thurses, spurns, tantarrabobs, swaithes, tints, tod-lowries, Jack-in-the-Wads, mormos, changelings, redcaps, yeth-hounds, colt-pixies, Tom-thumbs, black-bugs, boggarts, scar-bugs, shag-foals, hodge-pochers, hob-thrushes, bugs, bull-beggars, bygorns, bolls, caddies, bomen, brags, wraiths, waffs, flay-boggarts, fiends, gallytrots, imps, gytrashes, patches, hob-and-lanthorns, gringes, boguests, bonelesses, Peg-powlers, pucks, fays, kidnappers, gallybeggars, hudskins, nickers, madcaps, trolls, robinets, friars' lanthorns, silkies, cauld-lads, death-hearses, goblins, hob-headlesses, bugaboos, kows, or cowes, nickies, nacks necks, waiths, miffies, buckies, ghouls, sylphs, guests, swarths, freiths, freits, gy-carlins Gyre-carling, pigmies, chittifaces, nixies, Jinny-burnt-tails, dudmen, hell-hounds, dopple-gangers, boggleboes, bogies, redmen, portunes, grants, hobbits, hobgoblins, brown-men, cowies, dunnies, wirrikows, alholdes, mannikins, follets, korreds, lubberkins, cluricauns, kobolds, leprechauns, kors, mares, korreds, puckles korigans, sylvans, succubuses, blackmen, shadows, banshees, lian-hanshees, clabbernappers, Gabriel-hounds, mawkins, doubles, corpse lights or candles, scrats, mahounds, trows, gnomes, sprites, fates, fiends, sibyls, nicknevins, whitewomen, fairies, thrummy-caps, cutties, and nisses, and apparitions of every shape, make, form, fashion, kind and description, that there was not a village in England that had not its own peculiar ghost. Nay, every lone tenement, castle, or mansion-house, which could boast of any antiquity had its bogle, its specter, or its knocker. The churches, churchyards, and crossroads were all haunted. Every green lane had its boulder-stone on which an apparition kept watch at night. Every common had its circle of fairies belonging to it. And there was scarcely a shepherd to be met with who had not seen a spirit!
[Emphasis added] It is curious that the name occurs nowhere else in folklore, and there is no evidence that Tolkien ever saw this. The word also was recorded from 1835 as "a term generally used in Wales to express a quantity made up of four Welsh pecks" [in English court records for Hughes vs. Humphreys, a weights-and-measures case from Wales]. Hobbitry attested from 1947.