Sayyiduna Abu Huraira (may Allah be pleased with him) narrates this statement of the Prophet Muhammad (peace and blessings be upon him): "When a person comes to a gathering, he should greet (with salam). Then if he finds it appropriate to sit there, he may sit. And when he stands up (to leave), he should greet (with salam), because the first one is not more entitled than the second."
Hadith Referenceصحیح ابن حبان / كتاب البر والإحسان / 494
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيحسن صحيح - «الصحيحة» -أيضاً-.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده حسن، ففي ابن عجلان- واسمه محمد- كلام يسير لا ينزل عن رتبة الحسن، وباقي رجاله ثقات.