Siman 394
Presented here for study, not as a practical ruling. The Shulchan Aruch rules by Sephardi custom, the Rema's glosses by Ashkenazi custom, and the Kitzur follows Ashkenazi custom. For a practical question, ask your rabbi.
א אֵין מִתְקַשִּׁין עַל הַמֵּת יוֹתֵר מִדַּאי; וְכָל הַמִּתְקַשֶּׁה עָלָיו יוֹתֵר מִדַּאי, עַל מֵת אַחֵר הוּא בּוֹכֶה; אֶלָא שְׁלֹשָׁה יָמִים לִבְכִי, שִׁבְעָה לְהֶסְפֵּד, שְׁלֹשִׁים לְתִסְפֹּרֶת וּלְגִהוּץ.
1 One should not grieve excessively for the dead, and whosoever grieves excessively for him, will weep for another [dead] save that three days [are designated] for weeping, seven for lamenting, thirty [to abstain from] cutting the hair and wearing laundried garments.
ב בַּמֶּה דְּבָרִים אֲמוּרִים, בִּשְׁאָר הָעָם. אֲבָל תַּלְמִידֵי חֲכָמִים, הַכֹּל לְפִי חָכְמָתָם; וְאֵין בּוֹכִים עֲלֵיהֶם יוֹתֵר מִל' יוֹם; וְאֵין מַסְפִּידִין עֲלֵיהֶם יוֹתֵר מִי"ב חֹדֶשׁ; וְכֵן חָכָם שֶׁבָּא שְׁמוּעָתוֹ לְאַחַר י"ב חֹדֶשׁ, אֵין מַסְפִּידִין אוֹתוֹ.
2 This applies to the rest of the people, but [as to] scholars [who died], everything is according to their wisdom; and one does not weep for them more than thirty days, nor does one make a lamentation for them more than twelve months, and likewise, a Sage whose [death] report was received after twelve months, is not lamented.
ג יוֹצְאִין לְבֵית הַקְבָרוֹת וּפוֹקְדִים עַל הַמֵּתִים שְׁלֹשָׁה יָמִים, שֶׁמָּא עֲדַיִן הוּא חַי.
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.
ד כָּל שְׁלֹשָׁה יָמִים יִרְאֶה הָאָבֵל כְּאִלוּ חֶרֶב מֻנַּחַת לוֹ בֵּין כְּתֵפָיו; מִשִּׁלֹשָׁה וְעַד שִׁבְעָה, כְּאִלוּ זָקוּף כְּנֶגְדּוֹ בְּקֶרֶן זָוִית; מִשִּׁבְעָה וְעַד שְׁלֹשִׁים, כְּאִלוּ עוֹבֵר לְפָנָיו בַּשּׁוּק; וְכָל אוֹתָהּ הַשָּׁנָה הַדִּין מְתוּחָה כְּנֶגֶד אוֹתָהּ מִשְׁפָּחָה; וְאִם נוֹלָד בֵּן זָכָר בְּאוֹתָהּ מִשְׁפָּחָה, נִתְרַפֵּאת כָּל הַמִּשְׁפָּחָה.
4 During the first three days [of mourning], the mourner should look upon himself as if a sword is resting between his shoulders; from the third to the seventh, as if it is standing in the corner facing him; from the seventh to the thirtieth, as if it is passing before him in the market place; and throughout the entire year, the judgment is aimed against that family. But if a male child is born in that family, the entire family becomes healed.
ה אֶחָד מֵהַחֲבוּרָה שֶׁמֵּת, תִּדְאַג כָּל הַחֲבוּרָה.
5 When one [member] of a company dies, the whole company should feel troubled.
ו כָּל מִי שֶׁאֵינוֹ מִתְאַבֵּל כְּמוֹ שֶׁצִּוּוּ חֲכָמִים, הֲרֵי זֶה אַכְזָרִי; אֶלָא יִפְחַד וְיִדְאַג וִיפַשְׁפֵּשׁ בְּמַעֲשָׂיו וְיַחֲזֹר בִּתְשׁוּבָה.
6 Whosoever does not observe mourning rites as the Sages commanded is a cruel person, but one should fear and be troubled and investigate his conduct and repent.