There are few ways to say that...
"Pourquoi tu me quittes ?"
"Pourquoi faut-il que tu me quittes ?"
"Pourquoi dois-tu me quitter ?"
It depends what do you want to say exactly... Why this person is leaving you ? Is it in a relationship or is it just after visiting your friend?
French is a really precise language so you have to know the context of that sentence to obtain a good translation.