The line you’re referring to I believe is from the poem, “Oh, Captain! My Captain!”
The lines refers to the fact that the North has won the Civil War (in the United States).
When the speaker says “nothing gold can stay” Robert Frost is trying to symbolize the idea of no beauty or joy can last forever.