On a slope, the car is held mainly by the parking brake. If it isn't applied or the brakes are faulty, the car could roll away and cause injury or damage. Turning the wheels towards the side of the road helps stop it moving if that happens.
Downhill, with a kerb
Turn the steering wheel left so the front of the front left wheel rests against or close to the kerb. Then apply the parking brake.
Uphill, with a kerb
Turn the steering wheel right so the back of the front left wheel rests against or close to the kerb. Then apply the parking brake.
Uphill or downhill, no kerb
Turn the steering wheel fully left, so that if the car moves it heads towards the side of the road and away from the centre. Then apply the parking brake.