Answered by Sayyidi Habib Umar bin Hafiz (may Allah protect him and benefit us by him)
What is the best dua to recite at the end of a gathering?
The best dua is the dua which the Prophet ﷺ taught us:
سُبْحَانَكَ اللَّهُمَّ وَبِحَمْدِكَ أَشْهَدُ أَنْ لاَ إِلَهَ إِلَّا أَنْتَ أَسْتَغْفِرُكَ وَأَتُوبُ إِلَيْكَ
Subhanakallahumma wa bi hamdika ashadu alla ilaha illa anta astaghfiruka wa atubu ilayk
Transcendent are You, O Allah, and praise be to You as You praise Yourself. I bear witness that there is no deity save You. I seek Your forgiveness and I repent to You.
If possible you can also recite the verses of Habib `Abdullah bin Husayn bin Tahir which are traditionally recited at the end of gatherings. They can be found in the Khulasah. They should be recited before the Prophetic dua, which should be the last thing to be recited.