696. Maariv Following Shabbos
96:1 There is a practice to delay the evening service on Saturday nights and to extend the melody when saying Barchu in order to add from the secular to the holy. In Shemoneh Esrei, we add "Atah chonantanu," which is a form of havdalah. (One must say "Atah chonantanu" even if he already heard havdalah recited over a cup of wine - Mishnah Brurah 294:1.) If one forgot to say this but he remembered before saying G-d's Name in the bracha, he says it at the place where he remembered, then concludes the bracha from the word "v'chaneinu." If he remembered after saying G-d's Name, he finishes the bracha "Chonein hadaas" and he does not go back. This is because he will later make havdalah on a cup. One must be very careful not to do any work or eat anything before making havdalah on a cup because he did not say it in davening. If he did do work or taste food, he must daven again. (A person may do work if he says "Baruch haMavdil bein kodesh l'chol" - Blessed is the One Who separates between the holy and the secular - MB 294:3.) If a person forgot to say "Atah chonantanu" and he doesn't have a cup of wine over which to recite havdala, other rules apply. (If one didn't recite Maariv at all and he is saying a make-up prayer at Shacharis, he would not say "Atah chonantanu" if he heard havdalah over a cup; if he did not hear havdalah at all, he would recite "Atah chonantanu" in his second Shemoneh Esrei - MB 294:2.)
96:2 After the Shemoneh Esrei, we recite the half-kaddish, followed by "vayehi noam," because this is a song of blessing that Moshe used to bless the Jews after they completed building the Mishkan (Tabernacle). It should be recited standing and it is customary to recite the last verse, "orech yamim..." (''With long life..." Psalms 22:4), twice. After this, we recite "v'Atah Kadosh" ("You, Holy...") and a special arrangement of Kedusha because building the Mishkan caused G-d's Presence to dwell among Israel; this is what is meant by''You, Holy G-d, are enthroned among the praises of Israel."
If a yom tov occurs during the following week, even on Friday, we do not recite vayehi noam or v'Atah Kadosh because when we say in vayehi noam "the work of our hands establishes You," there must be six whole days that are suitable for work. (It must be a full yom tov, not a quasi-yom tov like Purim or erev Pesach - MB 295:3.) Once we don't say vayehi noam, we also don't say v'Atah Kadosh because they are connected (though we do say v'Yiten l'cha - Rema 295, intro).
After vayehi noam and v'Atah Kadosh, we say the full Kaddish, followed by v'Yiten L'cha ("May G-d grant you...") and Aleinu. All these additions to the evening prayers after Shabbos are in order to delay finishing the service so as to extend the time before the wicked have to return to their punishment in Gehinnom; the wicked do not return to their punishments until the last congregation has completed their prayers after Shabbos.