I will rather regard $I/I^2$ as $\Omega_{B/A}$, the module of differential forms.

First some necessary conditions. If $D$ is a sub-$A$-algebra of $B$ such that $\Omega_{D/A}=0$ (e.g. $D$ is a localization of $A$ or étale over $A$), the canonical map $\Omega_{D/A}\otimes_D B\to \Omega_{B/A}$ shows that $df=0$ for all $f\in D$. So if $A$ is a field (of characteristic $0$), you want it to be algebraically closed in $B$. If $A$ is not a field, to avoid $B$ to contain a localization of $A$, you almost want to suppose $\mathrm{Spec} B\to \mathrm{Spec}A$ be surjective.

These being said, now a sufficient condition.

Suppose $A$ is noetherian, integrally closed of characteristic $0$, $B$ is an integral domain, $\mathrm{Spec} B\to \mathrm{Spec}A$ is surjective, and its generic fiber is ~~smooth~~ of finite type and geometrically integral. Then the kernel of $B\to \Omega_{B/A}$ is equal to $A$.

Proof.

(1) Let $C$ be the kernel of $d : B\to \Omega_{B/A}$. This is a sub-$A$-algebra of $B$. The canonical exact sequence
$$ \Omega_{C/A}\otimes_C B\to \Omega_{B/A}\to \Omega_{B/C}\to 0$$
implies that $\Omega_{B/A}\to \Omega_{B/C}$ is an isomorphism because the first map is identically zero ($dc\otimes b\mapsto bdc=0$ if $c\in C$).

(2) Let $K=\mathrm{Frac}(A)$, $L=\mathrm{Frac}(B)$. Let us first show that $E:=\mathrm{ker}(L\to\Omega_{L/K})$ equals to $K$. Note that $E$ is a field. Applying (1) to the situation $A=K$ and $B=L$, we see that $\Omega_{L/K}\to \Omega_{L/E}$ is an isomorphism. This map is $L$-linear, and $\dim_L\Omega_{L/K}$ is the transcendental degree of $L$ over $K$ (here we use the characteristic zero hypothesis). Similarly for $L/E$. Hence $E$ is algebraic over $K$. But $B_K$ is geometrically integral over $K$, this forces $E=K$ (otherwise $L\otimes_K E$ is not integral).

(3) Let us show $C_K:=C\otimes_A K$ equals to $K$. Tensoring the exact sequence of $A$-modules
$$ 0\to C\to B\to \Omega_{B/A}$$
by $K$, we get the exact sequence
$$ 0\to C_K \to B_K \to \Omega_{B_K/K}. $$
First suppose $B_K$ is smooth over $K$. As $\Omega_{L/K}$ is a localization of $\Omega_{B_K/K}$ and the latter is a free (hence torsion free) $B_K$-module, the map $\Omega_{B_K/K}\to \Omega_{L/K}$ is injective. By (2) we then get $C_K=K$. In the general case, some dense open subset $U$ of $\mathrm{Spec}(B_K)$ is smooth. If $f\in B_K$ satisfies $df=0$ in $\Omega_{B_K/K}$, then $d(f_{|U})=0$ in $\Omega_{U/K}$. So $f{|_U}\in K$. As $B_K\to O(U)$ is injective, $f\in K$.

(4) Let us show $C=A$. We have $C\subseteq B\cap K$ (in fact the equality holds). So we have to show $B\cap K=A$. Let $g\in B\cap K$ viewed as a rational function on $\mathrm{Spec}(A)$. Then $A\subseteq A[g]\subseteq B$. For any prime ideal $Q$ of $B$, $g$ is regular at the point $Q\cap A$. So the image of $\pi : \mathrm{Spec}(B)\to \mathrm{Spec}(A)$ is contained in the complementary of the pole divisor of $g$. So the latter is empty by the surjectivity hypothesis on $\pi$. Therefore $g$ is a regular function (here we use the normality of $A$) and $C=A$.

**Add** Suppose $A, B$ are integral domains of characteristic $0$, $B_K$ is finitely generated over $K=\mathrm{Frac}(A)$~~, and $\Omega_{B_K/K}$ is torsion free over $B_K$~~. Then we proved above that the kernel of $d: B\to\Omega_{B/A}$ is contained in $B\cap K^{alg}$.

**Add 2** One can remove free or torsion-free condition on $\Omega_{B_K/K}$. The proof is a little modified in the step 3. We just notice that any integral variety in characteristic $0$ has a dense open subset which is smooth !

locallyconstant"? – user2035 Sep 14 '11 at 7:45