Extending from an enclosure
In practice and to begin with, there will mainly be two enclosures you will want to extend from: the small low enclosure and the small high enclosure.
Both of these have a 'low' and a 'high' side - you will first want to extend along from the 'high' side. I.e. in the diagram on the left, White should extend towards a, not on the left side of the board.
The main reasons why this is so should be clear from the diagrams: works better with her higher position on the left than
does with his low position on the right.
The small low enclosure, already being more territory-oriented, is usually seen with an extension on the third line. However, if the corner extended towards is your own, a fourth line extension is usually preferable, the extension being extra valuable as it is an extension from both corners. Otherwise, the presence of the opponent's stone or shimari in the corner normally indicates a third line extension. Extending on the fourth line would often give your opponent a free 'counter-extension' on the third line towards your extension which you will be obliged to respond on the third line, giving you an inefficient shape and leaving him sente.
(That's an over-simplified view. Charles Matthews)
As for the length of the extension: in nearly all cases the extension should be halfway across to the other corner (i.e. below the star-point marker).
As always, exceptions are numerous. If the opponent has a strong position in the opposite corner, typically after a joseki, this may be too far, and may leave you open for an invasion between your enclosure and the extension stone.
On the other hand, if like White above you can play an approach followed by a joseki that leaves you sente, you can play that, followed by the star-point afterwards. However, your opponent may not necessarily let you play the joseki that you want, though. Black should probably answer with a pincer at a or thereabouts.
Well, a candidate for a proverb could be don't always pincer. Charles Matthews