Because "The Devoted Friend" consists of two layers of narrative, the story also comprises two discrete settings. The first setting the reader encounters is that of the frame story: a pond in a world where animals talk and think like humans. It isn't possible to determine with certainty whether Wilde envisaged this world as a complete fantasy or simply as the real world with the single adjustment of animals being capable of human communication. However, based on the Water-rat's anecdote about the men who walked by the pond, it does not appear that animals are the sole or dominant inhabitants of this world. Indeed, just as in the real world, animals and humans live side by side. It doesn't necessarily seem as though the humans in this world are aware of the animals' human-like communication, but this is another aspect that Wilde leaves open-ended.
Despite the principal characters of the frame story being animals, the outer layer of the narrative nevertheless feels embedded in Wilde's world and time. The world of the frame story appears to encompass many of the same social conventions as the world it was written in. More specifically, certain details make the conversation feel especially like one that belongs to late-19th-century Britain, the world Wilde himself belonged to. An example is the Duck's desire to teach her children to behave properly so that they can be "in society." A second example is the Water-rat's uncritical esteem for the opinions of the intellectual figure he eavesdrops on. Literary critics were admired in the Victorian period, usually belonging to the upper strata of society. When the Water-rat makes a comment beginning with "every good storyteller nowadays," the reader is likely to imagine this "nowadays" as connoting Victorian England.
The narrative's inner story is set in a fictional, ordinary village. Most of the time, the narrative follows Hans in his garden, the Miller at his home, or Hans out on errands in the countryside. Besides indications that it is preindustrial, this setting lacks details that would give an impression of what age it belongs to, which makes the story feel timeless—like a parable. In fact, despite the obviously fictional nature of anthropomorphism, the story about Hans and the Miller feels more fictionalized than that of the animals. This is partly because the setting is so general. It is also because the behavior of the characters in this inner story is so exaggerated that they don't feel real, whereas the animal characters in the frame story feel more complex and relatable. Wilde pushes Hans's unquestioning willingness to be exploited by the Miller to extremes that feel totally unrealistic—very few people would undermine their own needs and wants to meet the demands of their friends. However, this unrealistic aspect is an important part of the setting. The Linnet never claims that the story he's telling is one that actually happened. Because his main intention is to teach the Water-rat a moral lesson, it is better to have a pared-down setting both spatially and temporally. A generalized setting can help a story like that of the Linnet feel more universal and thereby make readers take its lessons to heart more easily.