Sayyiduna Abu Hurairah (may Allah be pleased with him) reports that the Messenger of Allah (peace and blessings be upon him) said: "When any of you comes to a gathering, he should greet them with salam, and when he gets up to leave, he should (again) greet them with salam. The first salam is not more deserving than the second salam."
Related hadith on this topic