When it is said
It is not part of any church service. It comes from the Sayings of the Desert Fathers, stories of the early monks of Egypt that were written down from about the 400s.
Say it whenever there is no strength left for a longer prayer, at work, on the road or at someone’s bedside.
Where it comes from
Author by tradition
Too tired to walk on
St Macarius the Great had learned to weave baskets from the old monk who first guided him in the desert. One day he was carrying a load of baskets along a desert road when he grew so tired that he sat down. He told God that he had no strength. The Sayings of the Desert Fathers record that at once he found himself by the river.
The Sayings of the Desert Fathers, Macarius of Egypt (Greek); Orthodox Church in America, Venerable Macarius the Great of Egypt
Why St Isaac told the story
The monk St Isaac the Syrian retold the story in the 600s, in a homily against asking God for wonders. In his telling, Macarius did not ask God to do anything to comfort him. He only trusted himself to God, saying that he had no more strength. God then carried him and his baskets at once to the place he was going.
Isaac of Nineveh, Mystic Treatises, translated by A. J. Wensinck (1923), Treatise LX; Britannica, Isaac of Nineveh
In Greek
Ὁ Θεὸς, Σὺ οἶδας ὅτι οὐκ ἰσχύω.