The short answer
This one is genuine. It appears in Twilight of the Idols (1888), in a section of aphorisms Nietzsche titled with characteristic bravado, and it is faithfully translated. The interesting question is not whether he said it but what he was actually claiming — because the popular reading and Nietzsche's reading are not the same.
What people usually take it to mean
In everyday use it has become a consolation: whatever you are suffering will automatically turn into strength. That reading is comforting, extremely popular, and not obviously true. Plenty of hardship simply damages people. Read as a universal promise, the line is both false and, to anyone in genuine difficulty, a little cruel.
What Nietzsche was actually describing
He was writing aphorisms about hardness, discipline, and what he saw as the making of a self — not offering reassurance. In context the line is closer to a description of a particular temperament than a law of nature: for the person who can absorb and organise an experience, difficulty becomes material. It is a claim about how some people metabolise suffering, not a guarantee about what suffering does to everyone.
Why the softer reading took over
Because the sentence detaches so cleanly. Nine words, a clear rhythm, and no context required — the perfect shape for a poster, a lyric, or a tattoo. Once detached, it drifts toward the most comforting available meaning, which is generally what happens to aphorisms in the wild. Nietzsche, who wrote deliberately quotable prose, would probably have found this both irritating and unsurprising.
What this means for your English
Hardship does not automatically improve your English — deliberate practice does. The honest version of this line for a learner is narrower and more useful: difficulties you actively work through become strength. The mistake alone teaches nothing; the mistake you examine, correct, and repeat correctly is what builds fluency.