Johnny told Ponyboy to stay gold to remind him that he did not need to stay in the gang life.
Although Pony describes the greasers as protecting each other like family and assures the reader that the kids in his town divide their affiliation by socioeconomic status, the greasers are still a gang. The often get into trouble, with the law or with the other gang, the Socs.
Pony tells us that greasers are poorer than Socs, and also “wilder.”
Not like the Socs, who jump greasers and wreck houses and throw beer blasts for kicks … Greasers are almost like hoods; we steal things and drive old souped-up cars and hold up gas stations and have a gang fight once in a while. (Ch. 1)
Although he says he does not do those things, they are part of the life of a greaser. Pony is expected to participate in these activities eventually, especially fighting. He says that greasers can’t walk alone for fear they will be jumped by Socs.
Pony is different from the other Socs. He does well in school and likes to read. He is just a deep thinker overall. Johnny is aware of this. When he and Pony spend time on the run after Johnny accidentally kills a Soc, Johnny brings Pony a book and the two spend their time discussing the novel and poetry.
While on the run, in addition to reading Gone with the Wind, they discuss the Robert Frost poem “Nothing Gold Can Stay.” The poem is about young things in nature not lasting, but it also has a metaphorical quality for Pony. It means that as you get older, you get more corrupt. In the hospital, Johnny tells Pony to stay gold.
"We told him about beatin' the Socs and... I don't know, he just died." He told me to stay gold, I remembered. What was he talking about? (Ch. 10)
Johnny means that Pony has the potential to get out of the gang life. He can get an education, leave town, and become a responsible and contributing member of society. With Johnny’s last words, he reminds Pony that the gang life is dangerous and while not all greasers have a choice, he does.