"Would you rather I leave" is a short way of saying "Given the choice between leaving or staying, which one do you want me to do?"
"Would you rather I leave you alone?" is a short way of saying "Given the choice between leaving you alone or staying here with you, which one do you want me to do?"
So the basic question is "Given option X or option Y, which one would you rather that I do?" but sometimes only one option is mentioned because the other option (the opposite one) is obvious.
Does that help?