In a battle, just press Escape, then "Exit Battle". Just know that in a campaign, if you quit a battle it will more than likely be a loss, so save before you fight to ensure that you can try again without losing any soldiers should things not go your way.

In the Campaign Map, it's just about the same thing. Escape, then something along the lines of "Exit Campaign." I'm not quite sure what it says.