There is a Mitzva of comforting mourners after losing a close relative called Nichum Aveilim. This is typically done by paying a Shiva call at the place of mourning. See here for a complete overview of this Mitzva. Does one fulfill one's obligation only during the Shiva period or can this Mitzva be fulfilled even after Shiva? I have seen people say the verse to comfort mourners after Shiva is already completed. Are they just doing a nice thing or can they be Yotzei the Mitzva in this manner bedieved?
The Shulchan Aruch (Y.D. 385:2) details the protocol for Nichum Aveilim after Shivah:
הַמּוֹצֵא אֶת חֲבֵרוֹ אָבֵל בְּתוֹךְ ל' יוֹם, מְדַבֵּר עִמּוֹ תַּנְחוּמִין וְאֵינוֹ שׁוֹאֵל בִּשְׁלוֹמוֹ. לְאַחַר ל' יוֹם, שׁוֹאֵל בִּשְׁלוֹמוֹ וְאֵינוֹ מְדַבֵּר עִמּוֹ תַּנְחוּמִים כְּדַרְכּוֹ, אֶלָא מִן הַצַּד, שֶׁאֵינוֹ מַזְכִּיר לוֹ שֵׁם הַמֵּת, אֶלָא אוֹמֵר לוֹ: תִּתְנַחֵם .... וְעַל אָבִיו וְעַל אִמּוֹ מְדַבֵּר עִמּוֹ תַּנְחוּמִין כָּל י''ב חֹדֶשׁ; לְאַחַר י''ב חֹדֶשׁ מְדַבֵּר עִמּוֹ מִן הַצַּד.
One who finds his fellow a mourner in the first 30 days, he should comfort him but should not greet him. After 30 days he can greet him, but should not comfort him in the usual manner, rather in an subtle way, namely, that he should not mention to him the name of the deceased, rather he should say to him, “be comforted.”.... And for one’s father or mother one should comfort him all 12 months and after 12 months one should comfort him in an subtle way. (Sefaria)