Salad days" is an idiomatic expression, referring to a youthful time, accompanied by the inexperience, enthusiasm, idealism, innocence, or indiscretion that one associates with a young person. More modern use, especially in the United States, refers to a person's heyday when somebody was at the peak of his/her abilities—not necessarily in that person's youth.
The phrase was coined in Shakespeare's play Antony and Cleopatra in 1606. In the speech at the end of Act One in which Cleopatra is regretting her youthful dalliances with Julius Caesar she says:
"...My salad days, / When I was green in judgment, cold in blood..."
The phrase became popular only from the middle of the 19th century, coming to mean “a period of youthful inexperience or indiscretion." The metaphor comes from Cleopatra's use of the word 'green' — presumably meaning someone youthful, inexperienced, or immature.
Fowler's Dictionary of Modern English Usage summarizes several other possible meanings of the metaphor:
Whether the point is that youth, like salad, is raw, or that salad is highly flavoured, and youth loves high flavours, or that innocent herbs are youth's food.