I couldn't find a citation for this quote, which appears everywhere on the web. It appears to be a paraphrase of a section in the Discourses; from the Project Gutenberg "A Selection from the Discourses of Epictetus with the Encheiridion, translated by George Long":
HOW WE MUST EXERCISE OURSELVES AGAINST APPEARANCES ([Greek: phantasias]).—As we exercise ourselves against sophistical questions, so we ought to exercise ourselves daily against appearances; for these appearances also propose questions to us. A certain person's son is dead. Answer; the thing is not within the power of the will: it is not an evil. A father has disinherited a certain son. What do you think of it? It is a thing beyond the power of the will, not an evil. Cæsar has condemned a person. It is a thing beyond the power of the will, not an evil. The man is afflicted at this. Affliction is a thing which depends on the will: it is an evil. He has borne the condemnation bravely. That is a thing within the power of the will: it is a good. If we train ourselves in this manner, we shall make progress; for we shall never assent to anything of which there is not an appearance capable of being comprehended. Your son is dead. What has happened? Your son is dead. Nothing more? Nothing. Your ship is lost. What has happened? Your ship is lost. A man has been led to prison. What has happened? He has been led to prison. But that herein he has fared badly, every man adds from his own opinion. But Zeus, you say, does not do right in these matters. Why? because he has made you capable of endurance? because he has made you magnanimous? because he has taken from that which befalls you the power of being evils? because it is in your power to be happy while you are suffering what you suffer? because he has opened the door to you, when things do not please you? Man, go out and do not complain!