The poem’s meaning in the story refers to the fact that no one can stay young and innocent for long.
When Johnny and Pony are on the run, hanging out, Johnny comments about the beauty of the sunrise. This reminds Pony of a Robert Frost poem. He connects the poem to the moment because the poem is about how nothing stays young.
"The mist was what was pretty," Johnny said. "All gold and silver."
"Uhmmmm," I said, trying to blow a smoke ring.
"Too bad it couldn't stay like that all the time."
"Nothing gold can stay." I was remembering a poem I'd read once. (Ch. 5)
This poem becomes very significant to Johnny. When he is dying, he asks to speak to Pony. He quotes the poem to him, which demonstrates how affected he was by it. To Johnny, the poem has come to symbolize the innocence of youth.
I barely heard him. I came closer and leaned over to hear what he was going to "Stay gold, Ponyboy. Stay gold..." The pillow seemed to sink a little, and Johnny died. (Ch. 9)
Pony is deeply affected by Johnny’s death, of course. He understands what Johnny is telling him. Even though he is a greaser, and all of his brothers are greasers, this does not mean that he has to follow this lifestyle. He has a chance to be something else.
Pony has always been the deep one. He is good at school and likes to watch movies. Yet, through spending time with Johnny, Pony learns that his friend has depths he hadn’t realized. Johnny may not be good at school, but he does care and he is a good thinker. Johnny was very taken by Gone with the Wind, for example. Pony has a chance to "stay gold," meaning that he can rely on his education and his intelligence to make something of himself in the world.