It's about timing and control. You can jump from the wall at any point while you're sliding. Use your movement controls in the direction you want to go, then press the jump button, you'll leap off in the direction you're trying to move - as long as it's relatively close to an appropriate angle of reflection based on how you hit the wall. If you're pushing in a direction that doesn't fit with how you hit the wall, you'll either bounce straight up, or on the closest angle to where you're trying to go.
Pretty much, you just need to practise until you can do it the way you want to - and remembe you can stay closer to the wall if you jump at if on a sharper angle - but doing so is much harder to land the slide to start with.