This question has already been asked and answered. Please see the following links.
Poe's story takes place in seven connected but carefully separated rooms. This reminds the reader of the past significance of the number seven. (The history of the world was thought to consist of seven ages, just as an individual's life had seven stages. The ancient world had seven wonders; universities divided learning into seven subjects; there were seven deadly sins with seven corresponding cardinal virtues, and the number seven is important in mysticism.) Therefore, an allegorical reading of this story suggests that the seven rooms represent the seven stages of one's life, from birth to death, through which the prince pursues a figure masked as a victim of the Red Death, only to die himself in the final chamber of eternal night.