The setting is simply the place that the literary action occurs, although a better and more thorough definition usually includes the time and mood as well. Sometimes the setting is compared to modes of theatrical diction, where the same statement can be said with different accents or tone of voice, lending a different meaning. Likewise, details of the setting, such as night versus day, influence the way in which the action that takes place there is cast.
The overall setting of the story is Massachusetts in the year 1727, about a hundred years before the story was published. After briefly describing the location of a buried treasure (which is not mentioned again), the story's setting moves between a swamp with an old Indian fort, Tom's house, and Boston. The swamp is dark, foreboding and has some supernatural elements that make it a suitable place to put Old Scratch in terms of his characterization; a good majority of the story takes place in the swamp, and contributes to the overall mood of darkness and corruption. Tom's house is forlorn and miserable. Boston is full of people and business and comes across as more upscale.