I’ve seen this referred to by a lot of different name. Most commonly, the term frame story tends to indicate works like Arabian Nights, where there is, ahem, a framing story, and then a bunch of smaller stories inside. In fact, now I know that there is a word for the tale within a tale itself (the smaller nested element): inset tales or inset stories.
Found this courtesy of the Wikipedia page about the Golden Ass:
“Similar to other picaresque novels, The Golden Ass features several shorter stories told by characters encountered by the protagonist. Some act as independent short stories, while others interlock with the original novel’s plot developments.”
Anyway, this is a funnish quote about inset tales in Gothic novels:
“The Gothic inset, or tale within the tale, often deals with a dead or missing relative of the heroine and relates in some way to the riddle of the heroine’s identity or paternity. In Gothic fiction, inset tales are often introduced to the narrative by way of manuscript discoveries, and are so cabalistic as to sometimes require deciphering. The most elaborate example of an inset tale as a Gothic structural device is probably Maturin’s Melmoth The Wanderer, where the various tales are arranged concentrically, and the Wanderer’s chronicle of despair is recited by narrators within narrators within narrators.”