This remark was made to mathematics professor Oscar Veblen in May 1921, while Einstein was on his first lecturing visit to Princeton University (Apr/May 1921). He was responding to the news of an experimental result that a “non aether drift” had been found by Dayton C. Miller that at the Mount Vernon Observatory. (If true, that would contradict his theory of gravitation, but the result turned out to be false.) Stated in his native German:

“Raffiniert ist der Herr Gott, aber boshaft ist er nicht.”

One interpretation is that Einstein was expressing his belief that nature's secrets would eventually yield to human reason, even if only after much imagination and toil.1 Some say by this remark Einstein meant that Nature hides her secrets by being subtle, while others say he meant that Nature is mischievous but not bent on trickery.2

The quote, in German, was later carved in the stonework over the fireplace in the Einstein faculty lounge of the Princeton Department of Mathematics.

Hans Ohanian in his book Einstein's Mistakes3 says that the German word “Raffiniert” has an idiomatic meaning with a somewhat negative connotation, and is better translated as “cunning” or “crafty.” Thus, “God is cunning, but not malicious.” Einstein’s own translation given to Derek Price was “God is slick, but he ain't mean.”4

Nature bears long with those who wrong her. She is patient under abuse. But when abuse has gone too far, when the time of reckoning finally comes, she is equally slow to be appeased and to turn away her wrath. (1882)
-- Nathaniel Egleston, who was writing then about deforestation, but speaks equally well about the danger of climate change today.

Carl Sagan:
In science it often happens that scientists say, 'You know that's a really good argument; my position is mistaken,' and then they would actually change their minds and you never hear that old view from them again. They really do it. It doesn't happen as often as it should, because scientists are human and change is sometimes painful. But it happens every day. I cannot recall the last time something like that happened in politics or religion.
(1987) ...(more by
Sagan)

Albert Einstein:
I used to wonder how it comes about that the electron is negative.
Negative-positive—these are perfectly symmetric in physics. There is no
reason whatever to prefer one to the other. Then why is the electron
negative? I thought about this for a long time and at last all I could
think was “It won the fight!” ...(more by
Einstein)

Richard Feynman:
It is the facts that matter, not the proofs. Physics can progress
without the proofs, but we can't go on without the facts ... if the
facts are right, then the proofs are a matter of playing around with
the algebra correctly. ...(more by
Feynman)