In German you may say Auf Wiedersehen or Guten Tag when leaving. Both seem rather formal and may be inappropriate in a non-formal context.
What would be the alternatives? In what context can we use each of them?
There is a myriad of answers for that. Just try to summarize:
Also, loads of foreign language phrases are used (whatever someone thinks is "cool"), like:
Or anything else, I've even heard friends leaving with:
So, you see, there is no exact answer to that. Just listen to what people around you are saying, as it really varies from region to region, age to age and even from clique to clique!
Usually, "tschüss" is accepted everywhere, though, especially if you're not a native speaker. It probably isn't a good idea trying to pronounce "pfiat di" with a foreign accent. ^^
Edit I've added some marks to make the usage clearer.
° = pretty informal, maybe a bit immature
°° = very informal, use it only with good friends, may also be considered immature
°°° = usually way over the top for use by yourself, but don't be offended if you hear it
Guten Tag as a closing salutation is by far not as widely used as Auf Wiedersehen, which should be fine for all purposes where you would also use Sie instead of Du.
For a generic salutation that is more informal, you could use "Tschüss!", which I would translate as "See you!" or "Bye!". In southern Germany (especially Baden-Württemberg), there's also "Ade!" (emphasis on the e), and younger people often use "Tschau!".
Tschüss, Ade and Tschau have the same roots, originally even with a religious connotation (french adieu, "be with god" → atschüs → tschüss), but that is long gone.
The informal form really depends on the region. Tschüss is probably fine everywhere, but in other areas people will prefer Servus, or others.
Tschüss, or the Rhineland variant Tschöö originate from the French "Adieu" (As an aside: Much of Germany was occupied by France off and on over the last few hundred years, so there is a lot of French influence in the regional German of the Rhine area, and some of it has spread to Standard German).