How far can you safely extend from your own wall?
Choosing the right distance for an extension basically depends on your goal in extending as well as the relative strength of stones in that area. Also, we need to differentiate between extensions to just explore open areas and extensions from existing walls.

Extensions from a wall

Let's start with the basics first. There is a well known rule of thumb, called the "wall plus one" rule. If you got a wall of height n, extend n + 1 spaces.

Assuming your wall has a height of 2. Consequently, the basic distance for an extension should be 3 spaces.

$$Wcm1 Wall of 2, extend 3
$$ | . . . . . . . . . . . . . . . . X . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . X . . . . . , . . . O . X . . . |
$$ | . . . . . . . . . W . . . O X . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ -----------------------------------------


For a "wall" of height 1 (that is, a single stone), the safe distance is 2 spaces.

$$Wcm1 Wall of 1, extend 2
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . X . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . X . . . |
$$ | . . . X . . W . . O . . X . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ -----------------------------------------


"Safe" means that is is difficult to invade and split your stones. The reason why it is safe is that you can either capture an invading stone, or at least connect your stones so you're not left with two weak groups. There are several midgame joseki that revolve around this, and the details will become more apparent as your reading grows stronger.

$$Bcm1 Safe distance: Difficult to invade, white can choose from A or B to kill or cover the invading stone
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . a b . O . . . , . . . |
$$ | . . . . . . . O . 1 . O . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ -----------------------------------------


Extending further than wall-plus-one distance means your position is more open to invasion and typically leads to bad shape (it's difficult to fix the invasion point without becoming overconcentrated). On the other hand, extending less wide leads to immediate overconcentration. Neither is desirable, so especially beginners should heed the wall-plus-one rule.

$$Bcm1 Unnecessarily difficult: Two wide extensions are far easier to invade.
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . 3 . . . . . . . . . |
$$ | . . . , . . . 2 . , . O . . . , . . . |
$$ | . . . . . . O . 1 . . O . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ -----------------------------------------


Extensions to explore open areas

Sometimes, you simply want to extend along a side without having any kind of wall. In that case, the usual idea is to simply play in the center of the stones on that side (no matter whom they belong to).

$$Bcm1 Simple extension along the side
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . O . . . . . , . . . . . X . . . |
$$ | . . . . . . . . . 1 . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ -----------------------------------------


This means that, since you intentionally ignored the wall-plus-one rule, your opponent will be able to invade and split you. However, since you played right in the center, you can simply extend to get a base (this leads to the concept of miai), while your opponent will be left with a single stone stuck between two relatively safe groups of yours.

$$Bcm1 Invasion is possible, but we can handle it
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . O . . . . . , . . . . . X . . . |
$$ | . . . . . . 3 . . 1 . 2 . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ -----------------------------------------


Occasionally, you want to adjust the distance slightly, but this dives into the realms of tactics already.

Relative strength adjustment

The stronger you are, the further you should go, and the stronger the opponent, the more tight and defensive should you be. What does this mean in practice?

If your opponent is strong around, sometimes the wall-plus-one rule should be changed to wall-plus-zero, i.e. a tight extension. This means, in the classic sense of the word, overconcentration, but it makes for more safety which might be more important. Typically, this is chosen if the opponent already has a checking extension that interferes with your extension.

$$Wcm1 It's a good idea to hold back sometimes.
$$ | . . . . . . . . . . . . . . . X . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . X . . . . . , . . . O . X . . . |
$$ | . . . . . . . X . . 1 . . O X . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ -----------------------------------------


Extending further may provoke an invasion.

$$Wcm1 After B6, black can connect on either 'a' or 'b' and white has cuts.
$$ | . . . . . . . . . . . . . . . . X . . |
$$ | . . X . . . . . . . . 5 . . . . . . . |
$$ | . . . , . . . . . , 3 4 . O O . X . . |
$$ | . . . X . . . X . 1 . 2 . O X X . . . |
$$ | . . . . . . . . . b . 6 . a . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ -----------------------------------------


White can try to dodge, but is left without a base while black got extra points.

$$Wcm1 No base, no points.
$$ | . . . . . . . . . . . . . . . . X . . |
$$ | . . X . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . 7 5 3 . O O . X . . |
$$ | . . . X . . . X . 1 4 2 . O X X . . . |
$$ | . . . . . . . . 8 6 . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ -----------------------------------------


Compare to when there is no extra stone on the lower side.

$$Wcm1 The invasion does not work that well: Black can't escape, the invasion failed.
$$ | . . . . . . . . . . . . . . . . X . . |
$$ | . . X . . . . . . . . 5 6 . . . . . . |
$$ | . . . , . . . . . , 3 4 7 O O . X . . |
$$ | . . . X . . . . . 1 . 2 . O X X . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ -----------------------------------------


On the other hand, if you're really strong somewhere, the correct distance is "as far as possible"; ignore the vast space and go right to your opponent's corner. If he dares to invade and split your extension stone, attack him and make him suffer by using your thickness.

$$Bcm1 Wide extension is desirable
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . X . . . |
$$ | . . O . . . . . . . . . . X X O O . . |
$$ | . . . , . . . . . , . . X . . X O . . |
$$ | . . . O . 1 . . . . . . X . . X O . . |
$$ | . . . . . . . . . . . . . X X O O . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ -----------------------------------------