The short answer to your question is: almost never. Many counterexamples have already been constructed in the comments. Let me make another easy counterexample:
Example. Let $k$ be algebraically closed, and let $A = k[t]$, $B = k[\sqrt{t}] = k[x]$. Consider the automorphism $t \mapsto t+1$ of $A$. It cannot be extended to $B$, since $t+1$ is not a square in $B$ (equivalently, $x^2 + 1$ is not a square in $k[x]$).
Example. Similarly, the automorphism $t \mapsto t+1$ of $k(t)$ cannot be extended to $k(\sqrt{t})$. Thus, even for a finite extension of fields containing an algebraically closed field $k$, it is false in general.
Remark. This example is actually rather instructive, because $k[t]$ has many automorphisms: any $a,b \in k$ with $a \neq 0$ give rise to the automorphism $t \mapsto at + b$. When $b \neq 0$, this cannot be extended to $k[\sqrt{t}]$.
Similarly, the automorphisms of $k(t)$ over $k$ are given by $PGL_2(k)$. Indeed, automorphisms of $k(t)$ are the same thing as automorphisms of $\mathbb P^1$, since the category of transcendence degree $1$ field extensions of $k$ is equivalent to the category of smooth projective curves over $k$ with surjective maps.
Clearly a necessary criterion for an automorphism of $\mathbb P^1$ to extend to the double cover $\mathbb P^1 \to \mathbb P^1$ is that it preserves the branch locus $\{[0:1],[1:0]\}$. The only matrices that do this are $$\pmatrix{a & b\\c & d} \in PGL_2(k)$$ with either $b = c = 0$ or $a = d = 0$. This corresponds to the automorphisms $t \mapsto \lambda t$ or $t \mapsto \lambda t^{-1}$. Another way to see this is by letting the automorphism act on the complement $\mathbb A^1\setminus\{0\}$ of $\{[0:1],[1:0]\}$. This is given by $k[t,t^{-1}]$, and an endomorphism must map $t$ to an invertible element, i.e. to some $\lambda t^k$. It's an automorphism iff $k = \pm 1$.
Finally, these do indeed extend to automorphisms of the overlying $\mathbb P^1$, by $x \mapsto \sqrt{\lambda}\cdot x^{\pm 1}$. But this is really just a coincidence:
Remark. For a morphism of curves $C \to D$ and an automorphism $\phi$ of $D$, it is not in general sufficient for $\phi$ to fix the branch locus in order for it to lift to an automorphism of $C$. For example, let $C$ be a general curve of genus $\geq 3$. Then $C$ has no nontrivial automorphisms; see e.g. the various answers to this question. In particular, we can choose such $C$ to be defined over $\bar{\mathbb Q}$.
But if $C$ is defined over $\bar {\mathbb Q}$, then Belyi's theorem it admits a map to $\mathbb P^1$ ramified at three points only. (It should in principle be possible to write down an explicit example of a curve admitting a map to $\mathbb P^1$ ramified at three points and with no nontrivial automorphisms, but I don't have one at hand.)
Then any permutation of the branch locus can be realised by some automorphism of $\mathbb P^1$ (since $PGL_2(k)$ acts transitively on triples of points in $\mathbb P^1$), but this map cannot be extended to $C$ since $C$ has no automorphisms.
This gives more examples of transcendence degree $1$ field extensions $A \subseteq B$ of $k$ where a $k$-automorphism of $A$ does not extend to $B$.