Check the Local Rules on the score card to identify the boundaries of the course. These are normally defined by fences, walls, white stakes or white lines.
If your ball is lost outside a water hazard or out of bounds you must play another ball from the spot where the last shot was played, under penalty of one stroke, i.e. stroke and distance.
You are allowed 5 minutes to search for a ball. If it is not found within 5 minutes it is lost.
If, after playing a shot, you think your ball may be lost outside a water hazard or out of bounds you should play a provisional ball. You must state that it is a provisional ball and play it before you go forward to search for the original ball.
If the original ball is lost (other than in a water hazard) or out of bounds, you must continue with the provisional ball, under penalty of one stroke. If the original ball is found in bounds, you must continue play of the hole with it, and must stop playing the provisional ball.