We must accept finite disappointment but we must never lose infinite hope.
The quote comes from one of the at least 8 books that Martin Luther King Jr. wrote in his lifetime called "Strength to Love", published in 1963. The book used material from his sermons, and focused on scriptural teaching and dealing with the problems of racism. Notably missing from the contents were his more controversial antiwar and anti-capitalist views; focusing more on a message of love, as the title states.
The passage the quote is from has actually been sourced for quite a few notable quotes from King; here's an excerpt:
To guard ourselves from bitterness, we need the vision to see in this generation's ordeals the opportunity to transfigure both ourselves and American society. Our present suffering and our nonviolent struggle to be free may well offer to Western civilization the kind of spiritual dynamic so desperately needed for survival. Some of us, of course, will die without having received the realization of freedom, but we must continue to sail on our uncharted course. We must accept finite disappointment but we must never lose infinite hope. Only in this way shall we live without the fatigue of bitterness and the drain of resentment. This was the secret of the survival of our slave fore-parents.