If I've joined a game and not said anything, and have spent some time there, then I'll usually say goodbye and maybe congratulate them on what they've done there.
If I join a server and it takes annoyingly long for Add-Ons to download then I will normally just leave without a farewell.
If I have joined a server and said something to someone, which normally happens if someone greets me joining the server, then I will say farewell.
If I've been hosting a server, and I shut down, I give everyone a warning, ask them to save their stuff, and thank everyone for visiting, before saying a farewell.