Herodotus actually attributes this to Solon in a conversation with King Crœsus.
Deem no man happy, until he passes the end of his life without suffering grief
Many very wealthy men are not happy, while many who have but a moderate living are fortunate; and in truth the very rich man who is not happy has two advantages only as compared with the poor man who is fortunate, whereas this latter has many as compared with the rich man who is not happy. The rich man is able better to fulfil his desire, and also to endure a great calamity if it fall upon him; whereas the other has advantage over him in these things which follow: — he is not indeed able equally with the rich man to endure a calamity or to fulfil his desire, but these his good fortune keeps away from him, while he is sound of limb, free from disease, untouched by suffering, the father of fair children and himself of comely form; and if in addition to this he shall end his life well, he is worthy to be called that which thou seekest, namely a happy man; but before he comes to his end it is well to hold back and not to call him yet happy but only fortunate. Now to possess all these things together is impossible for one who is mere man, just as no single land suffices to supply all things for itself, but one thing it has and another it lacks, and the land that has the greatest number of things is the best: so also in the case of a man, no single person is complete in himself, for one thing he has and another he lacks; but whosoever of men continues to the end in possession of the greatest number of these things and then has a gracious ending of his life, he is by me accounted worthy, O king, to receive this name.
The History of Herodotus Book I, Chapter 32 http://www.sacred-texts.com/cla/hh/hh1030.htm.