Here is the definition of a truth function:
A truth function of $n$ arguments is a function of $n$ arguments that are the truth value $1$ (T) or $0$ (F).
For example, $A\to B$ generates the following truth function:
The textbook says there are a total of $2^{2^{n}}$ truth functions of $n$ variables. I want to figure out why that is?
Is it because $2^{n}$ represents the number of possible combinations of truth assignments for the $n$ variables and then for each combination, its truth function's value is either $1$ or $0$, so that makes a total of $2^{2^{n}}$ truth functions?

You are correct.
Suppose there are $m$ values of object and each object can have the freedom to be either $0$ or $1$. There are $2^m$ possibilities.
Here $m=2^n$ since each variable can take $0$ or $1$.