From the book, there is a scene where the Elio (Timothee Chalamet’s character) removes the pit from a peach and masturbates into it. Apparently, the director Luca Guadagnino was originally unsure if he wanted to keep this scene in his adaptation. From Wikipedia:
Guadagnino was tempted to remove the scene in which Elio masturbates into a pitted peach, finding it too explicit. Chalamet was also nervous about the scene, describing it as “a metamorphosis of some of the strongest ideas in the movie” and the key to illuminating the character’s “overabundant sexual energy”. Both Guadagnino and Chalamet believed it was implausible to masturbate with a peach, but each independently tested the method. To their surprise, it worked, so Guadagnino shot the scene and ultimately included it in the film.
Never say Guadagnino and Chalamet aren’t committed to their craft.
I just watched it for the first time a week ago, so pardon me if I’m misremembering. But I read it as like, he was horny and curious so he tried it, but he felt sort of ashamed right after. Then Oliver shows up and discovers his shame, AND teases him about it, so that amplifies Elio’s shame x100. Oliver forgets that Elio is still a child, and isn’t ready to be teased about something so vulnerable. So he switches to comforting Elio, and then they grow even closer.