The narrator is a woman suffering from post-partum depression. Her husband, John, is named, but the narrator never is named. This is the result of a first-person narration but, read in a feminist context, the fact that she is not named underscores her position as secondary (or less important) than the man's (John).
Although the narrator believes some activity would help her, the doctors and her husband (who happens to be a physician) keep her from doing anything. During Gilman's time (story was published in 1892), the idea that women were a (mentally and physically) weaker sex was much more generally accepted. By keeping her in the nursery, her experience is more like a prison sentence than a place of recovery. She has nothing to do other than contemplate her own depression and stare at the bars of her prison (the yellow wallpaper). It is her incarceration, not her depression, that leads her to hallucinate.
When she sees the woman in the wallpaper, it is as if she's looking into a mirror. Or, this woman symbolizes all other women in similar positions. She has no say in what happens to her. Her life is controlled by her husband. When she no longer even has the outlet of writing with which to vent her frustrations, she "projects" the way she feels onto the wallpaper, thus projecting the image of a woman imprisoned in the pattern.