In linguistics, binding is the grammatical dependence between a pronoun and its antecedent. Consider first some English sentences, to show the range of possibilities, then I'll outline the structures that constrain the choice of words:
(1) She awoke at seven o'clock.
(2) *Herself awoke at seven o'clock
In (1) the sentence doesn't tell us who she is, and we have to work this out pragmatically: it is someone previously mentioned, or clear from the context, or it can even introducing her in the first sentence of a story. Pronouns don't all need to have antecedents. However, the ungrammatical (2) shows that reflexive pronouns haven't got this freedom: ones like herself necessarily bind to some element with the same reference in the same sentence: you can't say (2) even about someone mentioned in the previous sentence.

In modern theories of syntax these two kinds of pronoun are distinguished, with the name pronoun reserved for ones like I, me, she, her, and anaphor for reflexives like myself, herself as well as reciprocals each other, one another. The different behaviour of pronouns and anaphors is central to binding theory, and most languages have a similar though not identical distinction.

(3) John saw himself.
(4) *John saw herself.
(5) John saw him.
(6) He saw John.
(7) John saw John.
In (3) the reflexive himself refers back to John: they necessarily co-refer; and (4) is ungrammatical no matter what the context. The anaphors have a strong structural dependence on the sentence they're in, and can't be assigned meaning pragmatically, the way we could if it was her. The anaphor herself needs a female antecedent close to itself.

Anaphors and pronouns have in some ways opposite properties. Where himself in (3) has to mean John, him in (5) can't mean John. It must mean John saw someone else, such as Bill. Likewise in (6) it must be Bill who saw John; furthermore, (7) must mean there are two different Johns. None of (5), (6), or (7) is grammatical if it's intended to mean (3), but all are if they're intended to refer to two people.

An expression is said to be bound if it co-refers to another expression earlier in the structure, and free otherwise. (3)-(6) show that anaphors must be bound, and pronouns can't be bound. A proper name such as John directly refers to someone and is called an R-expression, and (6)-(7) show that R-expressions can't be bound. This three-way distinction is the basic result of binding theory, but the problem is in elucidating exactly what 'structure' is to count as the binding domain in which expressions are bound or free.

(8) John wondered whether Bill saw himself.
(9) John wondered whether Bill saw him.
(10) John wondered whether Bill saw her.
(11) John wondered whether Bill saw John.
These sentences have an inner clause embedded in an outer one. In (8) the anaphor can only refer to its inner subject Bill, not the outer subject John: anaphors have to be locally bound. (9) is ambiguous, and the reference has to be worked out by pragmatics, not just grammar: the pronoun can't refer to the local antecedent Bill, but can refer to the long-distance antecedent John, or can refer to a third person Harry: so pronouns have to be locally free, but can be optionally bound outside their local domain. Here the binding domain appears to be the clause, not the sentence. (10) has the same structure as (9) but is unambiguous, as the bound reading is ruled out because the gender features of John and her mismatch. Finally, (11) is ungrammatical if it's the same John: so an R-expression can't be bound at any distance.
(12) John got up, then John dressed himself, then John made breakfast.
(13) John got up, then he dressed himself, then he made breakfast.
(14) John got up, then dressed himself, then made breakfast.
(15) *John got up, then dressed John, then made breakfast.
The nature of binding has not yet been made clear. I have so far treated it as if it was the same as co-reference, but there is a crucial structural difference. The copies of John in (12) co-refer but are not bound. (12) is an unusual way of saying it, but we can for a certain effect, and it would normally be read as meaning the same as (13). Here the pronouns 'he' and 'himself' do all co-refer with John, but only 'himself' is bound: it is locally bound within the clause 'he dressed himself'.

We also need to distinguish underlying structure from superficial variations made by movement and deletion (what used to be called deep structure and surface structure, but have been done away with in the latest versions of Chomsky's theories). We can omit some parts of parallel clauses if they co-refer: so (12)-(13) can also be said as (14). The anaphor himself superficially appears not to bind to a local antecedent any more, or to bind long-distance to John, but in the underlying structure there is still the local antecedent he binding it. We can confirm this by noting that (15) is ungrammatical (if there's only one John): the R-expression 'John' is bound in '[he] dressed John', and R-expressions mustn't be bound.

So why are (12)-(13) not examples of binding of their subjects? The reason is that the bound anaphor or pronoun has to be under a structural configuration called c-command in relation to its antecedent. All syntactic structures are binary trees, with words and phrases and clauses being nodes that dominate other nodes or are sisters of them. A node X c-commands a node Y iff a sister of X dominates Y. This is a fundamental notion in X-bar Theory, the general theory of syntactic trees, and here's a diagram of a simple sentence:

          IP
         /  \
        /    \
      DP     I'
     John   /  \
           /    \
          I     VP
         past  /  \
              /    \
             V     DP
           dress  himself
In this the DP 'John' is sister of the functional node I' (see X-bar Theory if you want the node labels explained, or just treat them as labels). So 'John' c-commands everything underneath the I', including the verb 'dress' and the pronoun 'himself'. This is the configuration that allows binding: X binds Y if it c-commands it and they co-refer. In a coordinated sentence like (12)-(14) the three separate parts are at an equal level in the tree: the first 'John' doesn't c-command the others, so there's no binding, so the restrictions on R-expressions don't apply.
(16) John asked Mary about herself.
(17) Mary asked Bill about herself.
(18) John asked Bill about himself.
In all three of (16)-(18) the subject c-commands the anaphor, and so does the object. They are all in the same clause or binding domain, therefore the anaphor can refer to either of the nodes that c-commands it. In (16) and (17) only one reading is possible that matches the gender features, but (18) is ambiguous and must be interpreted by pragmatics, such as context.

What we have so far is that the choice of anaphors or pronouns, and their possible interpretations, depends on whether they are free or bound in their binding domain. Binding has been defined as co-reference plus c-command, but the nature of the binding domain now needs to be refined. So far I have been treating it as the clause. Unfortunately the theory falls apart at this point. Even within English you get exceptional constructions that have required more and more convoluted redefinitions to get them to fit, for example to get over the fact the following is grammatical despite the lack of c-command:

(19) Pictures of himself please John.
The essence of binding theory is these three principles:
Principle A. Anaphors must be locally bound.
Principle B. Pronouns must be locally free.
Principle C. R-expressions must be free.
Languages can vary on exactly how the local domain is defined. Also, Principle A is not universal, since some languages have long-distance anaphora, and others have two kinds of anaphor, one that must be locally bound and one that need not be. An example of long-distance anaphora is the Japanese zibun, which can only co-refer with a subject, not an object, but unlike English it can refer to any of several subjects in a complex sentence:
(20) Bill-ga zibun-o hihan-sita.
= Bill-NOM self-ACC criticism-did.
= 'Bill criticized (him)self.'
(21) John-ga Mary-ni Bill-ga zibun-o hihan-sita to itta.
= John-NOM Mary-DAT Bill-NOM self-ACC criticism-did that said.
= 'John said to Mary that Bill criticized self.'
The inner clause (20) is a straightforward reflexive. The word zibun doesn't mark gender, but the only antecedent it can have is Bill. When this is embedded in (21) however, zibun can refer to either the inner subject Bill or the outer subject John, but not to the non-subject Mary.

Quantifiers and question words also behave like antecedents to bound pronouns, with similar principles underlying the choice.

(22) Everyone taught them(selves) French.
(23) No-one taught them(selves) French.
(24) Who taught them(selves) French?
Other places where a reflexive or SELF pronoun is used, but not used reflexively, also fail to obey binding principles: these are called logophors and in general represent someone's perspective.
(25) As for myself, you can do what you like.
(26) John invited Mary and myself.

Japanese examples, plus better explanation than I've read in any other source, from Peter Culicover, Principles and Parameters, 1997, OUP.