Tongans are, as reputed, very friendly people. Being able to say hello and goodbye, then, is very important if you don't want to offend anybody being friendly.
Malo e leilei (Mah-low eh laylay)
Malo e leilei is how you greet people in Tongan. It is used much like hello, although it literally translates as a congratulation or giving thanks that the other person is doing well.
The e and i in leilei should be pronounced individually as eh-ee rather than ay as I have above. Tongans do this with ease, but not many palangi (foreigners) bother.
Malei (Mah-lay)
Malei is a casual version of Malo e leilei, much like saying "Hi!".
Malei is a casual version of Malo e leilei, much like saying "Hi!".
Semi e (Semi eh)
Where Semi is the Tongan way of saying Sam, Semi e is another way that someone might greet me. However, I have only ever heard the e used in this way by Tongans calling out to passing foreigners "palangi e".
Should I stay or should I go now?
No, obviously that is not Tongan. However, how you say goodbye in Tongan depends on whether the person you are saying it to is staying or going.
Nofo a e (No-fo ah eh)
Nofo is the tongan word for "to stay". You would say "Nofo a e" to somebody if you are leaving and they are staying. If more than one person is staying you add mau and say "mau nofo a e" to them.
Alu a e (Ah-loo ah eh)
Alu is the Tongan word for "to go". You would say "Alu a e" to somebody when they are leaving. If you are both leaving, you would both say "Alu a e".
Curiously, Tongan children will always say "Bye" to you when you pass them in the street or on your bike. Naively, you might thing they have "Hello" and "Bye" confused, but in fact they are just translating "Alu a e" which they would say in greeting to anybody they knew who was passing.