In rugby union there is often a lot of kicking. To be onside and able to chase the ball, a player must be behind the kicker (or be the kicker himself) when the ball is kicked.
Law 11 cover all the aspect about it:
Offside and moving forward. When a team-mate of an offside player has
kicked ahead, the offside player must not move towards opponents who
are waiting to play the ball, or move towards the place where the ball
lands, until the player has been put onside.
11.2 Being put onside by the action of a team-mate
In general play, there are three ways by which an offside player can be put onside by
actions of that player or of team mates:
(a) Action by the player.
When the offside player runs behind the team-mate who last kicked,
touched or carried the ball, the player is put onside.
(b) Action by the ball carrier.
When a team-mate carrying the ball
runs in front of the offside player, that player is put onside.
(c) Action by the kicker or other onside player.
When the kicker, or team-mate who was level with or behind the kicker when (or after) the ball was kicked, runs in front of the offside player, the player is put onside. When running forward, the team-mate may be in touch or touch-in-goal, but that team-mate must return to the playing area to put the player onside.
and law 11.3 covers the onside but from the opponent team view
11.3 Being put onside by opponents
In general play, there are three ways by which an offside player can be put onside by an action of the
opposing team. These three ways do not apply to a player who is
offside under the 10-Metre Law.
(a) Runs 5 metres with ball.
an opponent carrying the ball runs 5 metres, the offside player is put
(b) Kicks or passes.
When an opponent kicks or passes the
ball, the offside player is put onside.
(c) Intentionally touches
When an opponent intentionally touches the ball but does not
catch it, the offside player is put onside.
So to clear it a little, if you are not behind the kicker, you have to wait for the kicker to run past yourself, or wait for the other team to catch the ball and play with it (in the case of a far kick, this is usually what happens)
source: IRB Laws (via the Wayback Machine). As of January 2019, the current offside law is Law 10 which contains essentially the same content but different wording.