A person must be clearheaded when he prays. Unlike many idol worshipers who perform their rituals using drugs and alcohol to attain a state of ecstasy, our petitions to Hashem are achieved through seriousness and deep thought. That is why the Torah commands the Kohanim not to enter the Temple and perform the divine service while inebriated (Leviticus 10:8-11). The Chachamim derive from this that one who is drunk or tipsy is prohibited from praying.
“Tipsy” is the word used to describe someone who is slightly under the influence of alcohol, and finds it somewhat difficult to concentrate and focus his thoughts, but is still capable of talking before the King. The word “drunk” is used to describe a person who drank so much that he cannot properly speak before the King.
B’dieved, one who prays while tipsy, since he is able to speak before the King, fulfills his obligation. Likewise, if he begins praying and then remembers that he is tipsy, he may finish his prayer (Eliyah Rabbah; Kaf HaChaim 99:2). However, a drunken person who mistakenly starts to pray is required to stop immediately, for the prayer of one who is intoxicated is an abomination. Even if he concludes his prayer, he does not fulfill his obligation. If he becomes sober before the permissible time to pray ends, he must go back and pray in accordance with the law (Shulchan Aruch 99:1).
The Chachamim say that a person who drinks a revi’it (86 ml; recent calculations are 75 ml) of wine is considered tipsy, and if he walks a mil (960 meters, approx. 5.97 miles) it will diminish the effect of the wine (Eiruvin 64b). However, we do not know how to compare the wine of those days to our wines today. Therefore, the rule is that any time he feels disoriented from wine or alcohol, he is considered tipsy, and when he feels his clarity of mind returning, he is permitted to pray (Shulchan Aruch 99:3; Mishnah Berurah 2).
According to the Rama, because kavanah in prayer has deteriorated throughout the generations, we are not so strict about this law, and even a person who becomes slightly inebriated is allowed to pray. This is especially true when one prays with a siddur, for then there is no need to worry that he might mix up the words of the prayer. Customarily, we rely on the Rama’s opinion when the permissible time to pray begins to expire (Mishnah Berurah 99:3, and 17, and see Kaf HaChaim 22). There are those who add that even to prevent missing prayer in a minyan, a person who is slightly tipsy is permitted to pray. On Purim, when it is a mitzvah to drink, it is customary to be lenient in allowing one who is tipsy to pray so that he will not miss praying in a minyan (see Peninei Halachah Zemanim 16:14).
Concerning Shema and its berachot, the poskim are divided. Therefore, l’chatchilah, someone who is tipsy or drunk should not recite them. Instead, he should wait until the effect of the wine wears off. If, however, the time to recite Shema is about to pass, a tipsy person should say the Shema with the berachot, and a drunken person should recite it while omitting the berachot (Rama 99:1; Mishnah Berurah 8).
A tipsy person may recite other berachot, for example, Birkot HaNehenin (the berachot one recites before deriving pleasure from something) and Asher Yatzar, but a drunken person should not recite them. Nevertheless, even a drunken person should recite berachot that he can recite only at that time. For instance, if he became drunk at a meal, he should still recite Birkat HaMazon. Similarly, if he relieves himself, he recites Asher Yatzar (Rama 99:1; Mishnah Berurah 11).
A person who has reached a state of intoxication such as Lot, and is unaware of what is happening to him, is considered a shoteh (a deranged person), and is exempt from performing all the mitzvot. Even the berachot that he did recite are considered invalid (Mishnah Berurah 99:11).