To answer this question, one must have a complete understanding of both the Realist movement and the Naturalistic movement.
Realism, historically defined as "the faithful representation of reality," typically focuses upon life of the middle-class. Evoked from the disapproval of the previous period, Romanticism, Realism was focused upon scientific methodology, history, and rational.
Naturalism is very similar to Realism given its base in science. Naturalists considered themselves as observers. One of the characteristics of Naturalism was the giving of power to nature over mankind. Naturalists did not believe in free-will.Typically, Naturalists depicted the lives of the lower class.
Many critics have found it very difficult to distinguish Realism from Naturalism. Many have found that one characteristic which defines the difference between Realism and Naturalism is the focus upon the socio-economic class depicted.
Therefore, based upon a distinction provided by David Pizer in The Cambridge Companion to American Realism and Naturalism: Howells to London, one could define Gilman's "The Yellow Wallpaper" as a work of Realism. The class depicted is far from that of the lower-level working (and struggling) class. Solely based upon this one distinction, the story is one written from the Realist perspective.
Although it is possible to associate Gilman's "The Yellow Wallpaper" with the literary movement of Realism, it has more in common with another literary movement, the Gothic, and many critics place it within this tradition. As with the fiction of Edgar Allan Poe and many of the female writers of Gothic tales, a dominant feature of the story is its atmosphere of horror, in which the deterioration of the narrator's mind causes the setting of the story to take on a frightening, supernatural character. As the narrator descends into madness, she imbues the wallpaper with an active preternatural malevolence, and imagines women trapped behind the wallpaper. The language becomes increasingly disjointed and overwrought and the imagery increasingly horrific as the narrator's mind disintegrates.
Many of the features of the story, including the woman-in-jeopardy narrative, the displacement of the heroine into a luxurious but ominous environment distant from her normal home, the focus on the narrator's psychological instability, the projection of that instability onto external objects, and the atmosphere of supernatural horror are typical of the Gothic.