Previous answers are correct, but ...
1) 'sera' means 'evening' and 'serata' means 'evening and what happens in it',
so, for example) you mostly use 'buona serata' when you are saying good-bye
to somebody that goes to a party, to a dinner with friends, to see a movie, etc.
In other cases, when you think that the other person's evening is quite plain (but could nonetheless be very interesting, like reading a fine book), I would use a plain 'buona sera', or, obviously, just 'ciao' as with friends.
2) You don't say 'buona sera' to friends, BUT you can say 'buona serata' to them, this is related to previous note (1).