A no-claim bonus, also known as no-claim discount, is gained once there are no claims.
This is earned step-by-step each year. By the 4th step, the insured will have a full no-claim bonus.
In case of a claim, the no-claim bonus is usually stepped back by 2 steps, that is 2 years. But this might vary depending on your particular insurance cover.