The following is an excerpt taken from Session 12 of the Anees ul-Arwah–The Malfuzat of Khwaja Uthman Haruni (rehmatullahi alyhe)–as recorded by Khwaja Moinuddin Chishti (rehmatullahi alayhe):
He said, “On the topic of greeting (saying assalam alaikum), the Blessed Messenger (peace and blessings be upon him and his family) said, “When one of you takes leave of a gathering then greet. Greeting is an expiation for past sins. Angels desire forgiveness (with their Lord) for the one who greets. The one who greets after rising from a gathering has the Mercy of God upon him. His good deeds and lifespan are increased.”
“Upon the tongue of Khwaja Yusuf Chishti (may Allah shower His mercy on him), I heard that he who greets when departing from a gathering earns the reward of one thousand virtuous acts, one thousand of his needs are fulfilled and he is cleansed from sin to such a degree as the day he was delivered from his mother’ s womb. A year of his sins are forgiven and a year of virtuous acts are written to his book of deeds. Additionally the reward of one hundred greater and minor pilgrimages (Hajj and Umrah) are recorded for him and one hundred trays of mercy are showered upon him.”
“Hazrat Ali (may Allah ennoble his face) always wished to be the first to greet the gathering of the Prophet (peace and blessings be upon him) when joining or leaving but the Messenger of God (peace be upon him) would always out do him in it (he would greet first). Greeting is the way (sunnah) of the Prophets (may peace be upon them all), but all of them were first to greet others.”
At this, the master completed his words of wisdom and became engrossed in his dhikr with the people and the one in need of his prayers having left–all praises to God for that (lesson).
Hadith 13: Tirmizi and Abu Dawud reported from Abu Hurairah Radi Allahu anhu that Rasoolullah Salla Allahu ta’ala’alayhi wa sallam said ‘When a person arrives at any gathering, he should convey Salaam. Then if he wishes to sit there, he may remain seated. If he wishes to get up from there (i.e. leave), then he should convey Salaam, because the first Salaam is not any better than the last Salaam’. In other words, just as that is Sunnat, this too is Sunnat.(BahareShariatVol16, Chapter 14 , p.187 )