If the bowler is able to get the ball past the batsman and hit the stumps with it the batsman is 'out' and their turn at batting is ended.
There are three other main ways for a batsman to get out:
Leg Before Wicket (LBW) - The batsman is not allowed to use their legs to stop the ball hitting the wicket. If they do, and the umpire thinks the ball would have hit the stumps, the player is out LBW.
Caught - If the batsman hits the ball away from the stumps, but a player on the fielding team is able to catch it before it hits the ground, the batsman is out.
Run out - When a batsman hits the ball away from the wicket they may try to run from one set of stumps to the other to score a run. If the ball is fielded quick enough, thrown back towards the wicket, and the stumps the batsman are running towards are knocked over with the ball, the batsman is run out.
There are another seven ways a batsman can be out. They don't happen very often, and are:
Handled the ball
Hit the ball twice
Obstructing the field
Retired - out