When you speak about where and when, you are speaking about the setting of a piece of literature. We can talk about this as the "Setting of Time" and the "Setting of Place." Let's explore both here.
Setting of Time
Mark Twain wrote his novel The Adventures of Tom Sawyer in the late nineteenth century, but the actual setting of the novel is in the decade of the 1840s. We can be sure of this because slavery is most definitely still in force. Gender roles were very specific and the vernacular of Missouri is well-established in The Adventures of Tom Sawyer. Another aspect of the time is the use of superstition and, specifically, bad luck, that marks the mid nineteenth century.
Setting of Place
Although it is a purely fictional town, the town in The Adventures of Tom Sawyer is well-known to be modeled after Twain's own hometown in Missouri called Hannibal. Obviously, the Mississippi river plays a main role in the book and is even considered a character by some Twain scholars. In addition to vernacular being a good element of the setting of time, it can also be a good element in analyzing the setting of place in that the vernacular used in The Adventures of Tom Sawyer is most definitely from Hannibal, Missouri. The life in the fictional town centers upon life on and near the Mississippi River, so that aspect of the setting is distinct, albeit unnamed.
Just in case you'd like a primary source quote. Here is one that is full of both time AND place. Note the vernacular AND the mention of the river!
Like it! Yes—the way I'd like a hot stove if I was to set on it long enough. No, Tom, I won't be rich, and I won't live in them cussed smothery houses. I like the woods, and the river, and hogsheads, and I'll stick to 'em, too.
The Book The Adventures of Tom Sawyer, written by Mark Twain in 1876, takes place in a little town called St. Petersburg, Missouri, on the Mississippi River sometime in the 1840's. The town is imaginary, but it's believed the novel is based upon the author's own life in Hannibal, Missouri.
Full of wit and humor, the book paints a pretty realistic picture of how life was during those days. The author's clever use of local dialect and quaint colloquialisms gives a very real feel to the book, making it one of the best loved classics of all time. The story is also full of subtle satire, poking gentle fun of many of the beliefs, superstitions, and practices of the river folk of his day and time.
The best books are those that delve into and explore the issues of love, danger, adventure, loyalty, bravery, and true friendship. The Adventures of Tom Sawyer has all these elements and more. Young and old readers alike have taken up this book at least once in their lifetime and never been sorry for a time well spent.