I heard you can say goodbye in several ways in Italian. What are the ways to say goodbye in Italian and when should I use each goodbye?
Yes, there different ways to tell goodbye:
Normally it's used in formal environments with person that aren't friends (but it's not mandatory)
It's used only between friends or colleagues. Children use this.
It's used rarely but it's used when one leaves a person and doesn't know when they will meet them again.
Buona giornata / Buona serata / Buona notte / Buon pomeriggio
These are used in place of Arrivederci or Ciao. They can be used both in formal environment or between friends. Pay attention to the fact that we use Buona sera/Buon giorno when we meet a person and Buona serata/Buona giornata when we leave them.
Apart the ones cited by @andreatosoni there are many informal ways to say goodbye:
that means take care and has also an informal equivalent in Si riguardi!
quite similar to the aforementioned
which are affectionate ways of saying good bye or even take care.
And many others:
Ti saluto / La saluto
Goodbye comes from "God be with you" (Dominus vobiscum) and it is a close relative of Addio, Adieu (Fr. Like the "Adieu, Adieu to you and you" from the children just going to bed in "The Sound of Music"), Adios (Sp, used more often), Mandi (Friuli, from "Mane in Deo", used all the time, also to mean arrivederci, ciao, buon giorno) and (less close) to "Gruss Gott" (Austria and Bavaria, used all the time, to mean good morning, good evening, ciao).
Many years ago addio was used in Italy also when parting for a short period. It is less and less used today, but it is worth knowing that it can still be used that way.