Letting $a_i$ and $b_i$ be as in your question, observe that the homomorphism $F_n \rightarrow F_n$ that takes $a_i$ to $b_i$ for all $1 \leq i \leq n$ is an isomorphism if and only if the $b_i$ generate $F_n$ (this uses the classical fact that a set of $n$ elements of $F_n$ that generate $F_n$ must be a free generating set). This suggests examining the resulting subgroup of $\text{Aut}(F_n)$.

Define $\Gamma_n$ to be the subgroup of $\text{Aut}(F_n)$ consisting of automorphisms $f$ such that $f(a_i)$ is conjugate to $a_i$ for all $1 \leq i \leq n$; this group is known as the *pure symmetric automorphism group*. Your question basically boils down to asking about the structure of $\Gamma_n$. Here there is quite a bit known. For instance, it is a classical theorem of Nielsen that $\Gamma_2$ is exactly the set of inner automorphisms of $F_2$, which is equivalent to what Lee did in his answer. Things are more complicated for higher $n$ (I don't think there is an easy description of the possible $g_i$ in your question for $n \geq 3$ ), but a large amount is known about $\Gamma_n$. For instance, the paper

Humphries, Stephen P.,
On weakly distinguished bases and free generating sets of free groups.
Quart. J. Math. Oxford Ser. (2) 36 (1985), no. 142, 215–219.

proves that it is generated by the elements $c_{ij}$ for distinct $1 \leq i,j \leq n$ defined by
$$c_{ij}(a_k) = \begin{cases} a_k & \text{if $k \neq i$},\\ a_j a_i a_j^{-1} & \text{if $k = i$} \end{cases}.$$

Also, McCool found a relatively simple presentation for it in terms of these generators in

McCool, J.,
On basis-conjugating automorphisms of free groups.
Canad. J. Math. 38 (1986), no. 6, 1525–1529.

There is also a large literature that comes from the theorem of Dahm that says that $\Gamma_n$ is isomorphic to the pure braid group of a set of $n$ unlinked circles in $\mathbb{R}^3$; see

Goldsmith, Deborah L.
The theory of motion groups.
Michigan Math. J. 28 (1981), no. 1, 3–17.

for a proof of this (Dahm never published his result) and also see

Brendle, Tara E.; Hatcher, Allen,
Configuration spaces of rings and wickets.
Comment. Math. Helv. 88 (2013), no. 1, 131–162.

for many interesting generalizations of this. One important result that comes out of this fact is a computation of the integral cohomology ring of $\Gamma_n$ in

Jensen, Craig; McCammond, Jon; Meier, John,
The integral cohomology of the group of loops.

Geom. Topol. 10 (2006), 759–784.