Definition. Let $F^* : \mathcal{X}^\mathcal{B} \to \mathcal{X}^\mathcal{A}$ be the functor $P \mapsto P F$. The global left Kan extension of $F$ is a functor $F_! : \mathcal{X}^\mathcal{A} \to \mathcal{X}^\mathcal{B}$ such that $F_!$ is left adjoint to $F^*$. The global right Kan extension of $F$ is a functor $F_* : \mathcal{X}^\mathcal{A} \to \mathcal{X}^\mathcal{B}$ such that $F_*$ is right adjoint to $F^*$.
What this mean in elementary terms? If $Q : \mathcal{A} \to \mathcal{X}$ is a functor, then we are looking for a functor $P : \mathcal{B} \to \mathcal{X}$ such that $P F \cong Q$. In general such a $P$ does not exist, but $F_! Q$ and $F_* Q$ are the best approximations possible, in the following sense: there are natural transformations $\eta_Q : Q \Rightarrow (F_! Q) F \qquad \epsilon_Q : (F_* Q) F \Rightarrow Q$ such that for any $P : \mathcal{B} \to \mathcal{X}$ and any natural transformation $\alpha : P F \Rightarrow Q$, there is a unique natural transformation $\alpha' : P \Rightarrow F_* Q$ such that $\alpha = \epsilon_Q \bullet \alpha' F$, and for any natural transformation $\beta : Q \Rightarrow P F$, there is a unique natural transformation $\beta' : F_! Q \Rightarrow P$ such that $\beta = \beta' F \bullet \eta_Q$.
Theorem. If $\mathcal{X}$ is the category of sets and $\mathcal{A}$ and $\mathcal{B}$ are both small categories, then the global left and right Kan extensions of $F$ exist.
Proof. The left Kan extension is given by the coend formula $(F_! Q)(b) = \int^{a : \mathcal{A}} Q(a) \times \mathcal{B}(F a, b) \cong \varinjlim_{f : F a \to b} Q(a)$ and the right Kan extension is given by the end formula $(F_* Q)(b) = \int_{a : \mathcal{A}} Q(a)^{\mathcal{B}(b, F a)} \cong \mathcal{X}^\mathcal{A} (\mathcal{B}(b, F(-)), Q)$ Further details can be found in [Categories for the working mathematician, Ch. X].
More generally, if $\mathcal{X}$ is a category with enough colimits (having all colimits of size $\max \left\lbrace |{ \operatorname{ob} \mathcal{A} }|, |{ \operatorname{mor} \mathcal{A} }|, \max \left\lbrace |{ \mathcal{B}(F a, b) }| \middle| a \in \operatorname{ob} \mathcal{A}, b \in \operatorname{ob} \mathcal{B} \right\rbrace \right\rbrace$ is sufficient), then the global left Kan extension exists, and if $\mathcal{X}$ has enough limits (having all limits of size $\max \left\lbrace |{ \operatorname{ob} \mathcal{A} }|, |{ \operatorname{mor} \mathcal{A} }|, \max \left\lbrace |{ \mathcal{B}(b, F a) }| \middle| a \in \operatorname{ob} \mathcal{A}, b \in \operatorname{ob} \mathcal{B} \right\rbrace \right\rbrace$ is sufficient), then the global right Kan extension exists.