The setting in this poem includes both time and place. The author first gives us a sense of both mood and time with the first line:
"Once upon a midnight dreary,"
We as readers are then told that the author/narrator is in his study, as evidence is given of the books, the bust of Pallas, and the other ecoutrements that lend themselves to studious labors. We are certain that this is, at the very least, a room, as Poe refers to his "chamber door" multiple times throughout the poem. In closing, we can conclude that this poem is set in the 1800s, on a dark and stormy night, in the author's place of academic study and leisure.
It seems as though the Author's purpose is to appeal to a reader's sense of positivity.