The Shulchan Aruch · Yoreh De'ah
יורה דעה שצ״דYoreh De'ah 394
Siman 394 of 402 in Yoreh De'ah — 6 se'ifim
הלכות אבילותMourning· siman 394
Se’if 1א׳
אֵין מִתְקַשִּׁין עַל הַמֵּת יוֹתֵר מִדַּאי; וְכָל הַמִּתְקַשֶּׁה עָלָיו יוֹתֵר מִדַּאי, עַל מֵת אַחֵר הוּא בּוֹכֶה; אֶלָא שְׁלֹשָׁה יָמִים לִבְכִי, שִׁבְעָה לְהֶסְפֵּד, שְׁלֹשִׁים לְתִסְפֹּרֶת וּלְגִהוּץ.
One should not grieve excessively for the dead, and whosoever grieves excessively for him, will weep for another [dead]1M.K. 27b in accord with Rab Judah on the authority of Rab. save that three days [are designated] for weeping, seven for lamenting, thirty [to abstain from] cutting the hair and wearing laundried garments.2M.K. ibid., for it is written, “‘Weep ye not for the dead, neither bemoan him” (Jer. XXII, 10), which is explained as follows: ‘“Weep ye not for the dead” — excessively; “neither bemoan him” — beyond measure. In what matter? — Three days for weeping and seven for lamentation etc.’ (ibid.).
Se’if 2ב׳
בַּמֶּה דְּבָרִים אֲמוּרִים, בִּשְׁאָר הָעָם. אֲבָל תַּלְמִידֵי חֲכָמִים, הַכֹּל לְפִי חָכְמָתָם; וְאֵין בּוֹכִים עֲלֵיהֶם יוֹתֵר מִל' יוֹם; וְאֵין מַסְפִּידִין עֲלֵיהֶם יוֹתֵר מִי"ב חֹדֶשׁ; וְכֵן חָכָם שֶׁבָּא שְׁמוּעָתוֹ לְאַחַר י"ב חֹדֶשׁ, אֵין מַסְפִּידִין אוֹתוֹ.
This applies to the rest of the people, but [as to] scholars [who died], everything is according to their wisdom;3Tur citing RaShBA. and one does not weep for them more than thirty days,4Derived from Rabbi’s instructions prior to his death, viz., ‘Reassemble the College after thirty days for I am not more important than Moses of whom it is written, “And the children of Israel wept for Moses in the plains of Moab thirty days”’ (Deut. XXXIV, 8) — Ket. 103b. nor does one make a lamentation for them more than twelve months,5Ket. ibid. and likewise, a Sage whose [death] report was received after twelve months, is not lamented.6Yeb. 79a. Cf. M.K. 21b. This applies even on the day that the death report is received — Shak.
Se’if 3ג׳
יוֹצְאִין לְבֵית הַקְבָרוֹת וּפוֹקְדִים עַל הַמֵּתִים שְׁלֹשָׁה יָמִים, שֶׁמָּא עֲדַיִן הוּא חַי.
One may go out to the cemetery and visit the dead until three days [after being placed in the sepulchral chamber], for perhaps he is still alive.7Sem(H). VIII, 1. According to some versions ‘until thirty days.’ Cf. A.R.N. § XLI; Yad, Ebel IV, 4 also RIDBaZ and Migdol Oz a.l.; Sem(H). Int. VI, 4. This custom refers to Talmudic days when it was customary to bury the dead in sepulchral chambers and it was possible to view the corpse in order to determine whether the person was really dead — ShaK. Cf. Sam. ibid. where it is related that it once happened that one visited an entombed person and the latter was found living and lived twenty years thereafter and begat children.
Shulchan Aruch, Yoreh De'ah — Torat Emet 357 edition, via Sefaria — public domain
English: Code of Hebrew Law, tr. Chaim N. Denburg, Montreal 1955 — CC BY