Spanish Inquisition. Ugh. Okay, we just had to get that out. We know from the very beginning of the story that it takes place during the Spanish Inquisition in Toledo, Spain. But all that really tells us is: (a) that our narrator is probably being punished for a crime related to religious heresy (i.e. not agreeing with the people in charge), and (b) that it takes place sometime between the thirteenth and nineteenth centuries. Hmm, not very helpful.
At the end of the story, though, we find out that this is all going down toward the end of the Inquisition. Okay, so we're in the early 1800s, when Napoleon and his guys turned on their allies, invaded Spain, and (kind of) ended the Inquisition. Although the exact endpoint of the Inquisition is hard to pinpoint, the rise of Napoleon sounded the death knell of what was, essentially, a dying regime.
Be careful, though. Sure, General Lasalle was a real guy, but he didn't have anything to do with the capture of Toledo. On a similarly historically fuzzy note: the seriously crazy torture devices described by our narrator probably weren't being used in the 1800s. These sound more like the kinds of things that were popular in the Middle Ages (you know, the ones you see at museums these days). Oh, and there's really no religious content to the story – the narrator says himself that he's been passed over in the autos de fé which are usually reserved for heretics. So basically, everything we thought we knew from the setting is kind of, well, wrong.
In the end, none of this history (or lack thereof) really matters. Wait, what? The setting doesn't matter? Yep, Shmoopers, that's what we're claiming. (Of course, this is just our opinion.) All Poe really wants is a pretext (a reason/justification) for horror and gruesome torture. And guess what? The Inquisition gives him just that.
Our narrator is placed in a sort of alternate reality of Poe's own creation. Sure, this spectacular dungeon could have possibly existed under the terrible regime, but we have no way of knowing. Poe's zigzag through real history and his imagination is perhaps the most horrific of all – maybe even scarier than if it were entirely made up.