He was telling Ponyboy that he was a good person, and advising him to stay that way.
"Stay Gold" Which means stay innocent.
"Stay gold Ponyboy. Stay gold....." (< those were Johnny's last words)
I personally think Johnny's last words "Stay gold Pony, stay gold." meant that he didn't want Ponyboy to change or to harden up like Dally or Darry. He wanted him to stay the way he was.
"Stay gold, Ponyboy"
"Stay Gold, Ponyboy, Stay Gold..."
It relates to this because Johnny at the end of the book is telling Ponyboy to "stay gold" and to look at the sunsets. Also when it says "So dawn goes down to day" it is saying that nothing lasts forever.
"Stay Gold, Ponyboy, Stay Gold..."
Stay gold, Ponyboy. Stay gold.
"Stay Gold, Ponyboy, Stay Gold..."
"Stay Gold, Ponyboy, Stay Gold..."
"Stay gold ponyboy, stay gold."
"stay gold, ponyboy. stay gold." <3