I used this phrase in a conversation with my wife yesterday and was surprised to learn that she had never heard of it. This led me to wonder where it came from.
By request from the comments: here is a link to a Language Log post that, among other things, explains the origin of the phrase.
from your mouth to God's ear (or ... to the Gates of Heaven). May God hear what I/you say and act upon it. Or, as defined in The Taste of Yiddish by Lillian Merwin Feinsilver (1970): 'Fun zayn moyl, in Gots oyer. Lit, From his mouth into God's ear. May God hear what he has said (and fulfil it)!' The 'Gates of Heaven' may be an Arab version. ... The first expression my stem from Psalm 130:2: 'Lord, hear my voice: let thine ears be attentive to the voice of my supplications'. The phrase also appears in the orthodox Jewish prayer book.
The explanation above taken from
Nigel Rees, Cassell's Dictionary of Word and Phrase Origins (2002), p. 90
"From your lips to God's ear" appears in Arabic (من فمك لباب السما ياختي) about as much as in Hebrew (מפיך לאוזני אלוהים). The expression does not appear in Hebrew literature before the rebirth of modern Hebrew in the last century. In modern Hebrew it is commonly used in contexts such as ynet.co.il blogs that indicate that the writer believes the origin of the phrase is Arabic. I venture to guess that the expression migrated from the Arabic to the Jewish colloquial in Andalusia and from there to the Yiddish. A quote from Arabic literature of the period might answer the question more conclusively. In any event, the expression is loaned in English. The expression can be used to indicate true heartfelt agreement and can also be used sarcastically or wryly as in "would that it were so", or "insha'alah".
There's a similar proverb in the Apochrypha, Sirach 21:5
The prayer of the poor goes from their lips to the ears of God, and His judgment comes speedily.
There are two forms of this idiom. The first which you identify:
Idiom expressing a wish that the desires of the person to whom the saying is spoken will come true. The original, literal meaning of the saying indicates that the speaker wishes that whatever the addressee has just said will be heard by God and answered.
May be used sarcastically, in which case it is roughly equivalent to "good luck with that."
Eg. J: "Hopefully, my investments are going to return 400%!"
M: "From your lips to God's ears."
The second form is less common and reversed. It is from God's lips to your ears.
It simply means the instruction came from on high and was passed to you directly (no one else heard/knows). It conveys a high level of confidence/knowledge in the information passed.
Eg. J: "John was fired by Tom" M: "How do you know?" J: "All I can say is that this is from God's lips to your ears".
The phrase "From your mouth to God's ears" appears in Bandit, a short story written in Yiddish by Sholem Aleichem (better know as the author of Fiddler on the Roof), who lived from 1859 to 1916. The version "From your lips to God's ears appears in the novel The Devil's Arithmetic, written by Jane Yolen about a Jewish girl in New York who is transported back in time to a Nazi death camp. And the phrase is something I hear often from Jewish friends. (I'm Jewish but was brought up outside the community.) When my friends use it, it takes on the meaning of "You said it! You hit the nail on the head!" In other words, what you've said so perfectly explains something that it can be heard by God. It's not hard to conclude that the phrase is one of the Yiddishisms that has entered mainstream American culture. I've seen it described as a "Jewish proverb," which seems likely.