The Shulchan Aruch · Orach Chayim
אורח חיים צ״אOrach Chayim 91
Siman 91 of 697 in Orach Chayim — 6 se'ifim
הלכות תפילהLaws of Prayer· siman 91
Se’if 1א׳
הָיְתָה טַלִּית חֲגוּרָה עַל מָתְנָיו לְכַסוֹתוֹ מִמָּתְנָיו וּלְמַטָּה, אָסוּר לְהִתְפַּלֵּל עַד שֶׁיְּכַסֶה לִבּוֹ, וְאִם לֹא כִּסָה אֶת לִבּוֹ אוֹ שֶׁנֶּאֱנַס וְאֵין לוֹ בַּמֶּה יִּתְכַּסֶה, הוֹאִיל וְכִסָה עֶרְוָתוֹ לְהִתְפַּלֵּל, יָצָא.
That One Should Gird One's Waist and Cover One's Head During the Time of Prayer: containing six s'ifim. If there was a garment (i.e. cloak, sheet) tied around one's waist, to cover from their waist down, then it is forbidden to pray until they cover their heart (ie. put on a shirt). If one did not cover their heart or is unable due to having nothing to cover themselves, since they covered their nakedness [genitalia] and prayed, they have fulfilled their obligation.
Se’if 2ב׳
צָרִיךְ לֶאֱזֹר אֵזוֹר בִּשְׁעַת הַתְּפִלָּה, אֲפִלּוּ יֵשׁ לוֹ אַבְנֵט שֶׁאֵין לִבּוֹ רוֹאֶה אֶת הָעֶרְוָה, מִשּׁוּם הִכּוֹן. אֲבָל שְׁאָר בְּרָכוֹת מֻתָּר לְבָרֵךְ בְּלֹא חֲגוֹרָה, מֵאַחַר שֶׁיֵּשׁ לוֹ מִכְנָסַיִם: הַגָּה: וְאֵין לִבּוֹ רוֹאֶה אֶת הָעֶרְוָה (רַ"ן פֶּרֶק קַמָּא דְּשַׁבָּת וְהָרֹא"שׁ פֶּרֶק הָרוֹאֶה וְהַגָּהוֹת מַיְמוֹנִי פֶּרֶק ה' מֵהִלְכוֹת תְּפִלָּה).
One needs to wear a belt at the time of prayer, even if he is wearing pants, such that his heart does not "see" his nakedness, because of הכון/prepare ("Prepare to meet your God, O Israel" (Amos 4:12)). But [regarding] the rest of the blessings, it is permitted to bless them without a belt, so long as one is wearing pants. Rem"a: and one's heart does not see the nakedness (Ran, First Chapter of Shabbat and the Rosh, Chapter "ha-Ro-eh", and Hagahot Maimoni on Tefillah Chapter 5)
Se’if 3ג׳
יֵשׁ אוֹמְרִים שֶׁאָסוּר לְהוֹצִיא הַזְכָּרָה מִפִּיו בְּרֹאשׁ מְגֻלֶּה, וְיֵשׁ אוֹמְרִים שֶׁיֵּשׁ לִמְחוֹת שֶׁלֹּא לִכָּנֵס בְּבֵית הַכְּנֶסֶת בְּגִלּוּי הָרֹאשׁ.
There are those who say that it is forbidden to mention [God's name] with an uncovered head. And there are those who say that one should object that people should not enter the synagogue with an uncovered head.
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0