There are two approaches to this subject. The first is based on the idea that the narrator is speaking literally, and the second, that he or she is speaking figuratively.
In the first approach, if the bird is real, it came in through the window. The narrator threw the shutters open, and in "stepped a saintly raven."
The second approach, which is the most common interpretation, is that the raven is a representation of the narrator's perpetual, unassuageable grief. Evidence for this interpretation includes the description that the bird "stepped" rather than "flew" into the room, and that it comes from the past, or "yore."
In addition, that it speaks and repeats "nevermore" is fantastic. The bird also stays in one place, and for an unspecified, apparently long time: "never flitting, still is sitting, still is sitting"--the only place a word is emphasized.
The description of the shadow cast on the floor and the narrator's soul being trapped in it are among the other indications that the bird is a metaphor for mourning.
And my soul from out that shadow that lies floating on the floor
Shall be lifted—nevermore!