Let $G$ be a group acting on a nonempty set $S$. Then $G$ also acts on the set of subsets in $S$.
Let $U$ be subset in $S$. Then the stabilizer of $U$ is $$G_{U}=\{ g\in G \mid gU=U\}$$
The author briefly mentioned that $G_{U}$ can be also written as $$G_{U}=\{g\in G \mid gu\in U, \forall u \in U\}$$
I do not quite see this. If $U$ is finite, then these two definition are interchangeable as the map $U\rightarrow U, u\mapsto gu $ is injective and hence also surjective (a injective map from a finite set to itself is also surjective.) But I do not think they are the same thing if $U$ is infinite. (Let $G$ be $\mathbb{Z}$ with addition and let $U=\mathbb{Z}_{\geq0}$, then by the second definition $1$ is a stabilizer of $U$, but by the first definition it is not.)
Which one should be the correct definition or did I understand this incorrectly?
I may need this to prove the following result:
$G_{U}=G \Leftrightarrow U$ is a union of $G$ orbits on $U$
Form LHS to RHS is easy, as $G_{U}$ is a subgroup of $G$. We can restrict the group action from $G$ to $G_{U}$ and therefore $G_{U}$ acts on $U$. i.e $U$ is a union of $G_U$ orbits on $U$. If $G_U=G$, then $U$ is a union of $G$ orbits on $U$.
If I assume the first definition to be true I cannot get the if direction. But if I assume the second definition then things will become much easier.
For the purpose of this answer let's agree on your first definition, $G_U = \{g \in G : gU = U \}$.
(As noted in comments, your second definition is simply wrong, because it does not define a subgroup, and some authors, including Wielandt in his book on Permutation Groups, use a different definiton $G_U = \{g \in G : \forall u \in U, gu=u \}$.)
The question is, suppose that $U$ is a union of orbits of $G$ on $S$. Prove that $G_U = G$.
So we have to prove that $gU=U$ for all $g \in G$, and to do that we need to prove that $gU \subseteq U$ and $U \subseteq gU$.
Let $u \in U$. Then $gu$ is in the orbit of $G$ on $U$. But, since $U$ is a union of orbits of $G$ on $U$, this orbit must be contained within $U$, and so $gu \in U$. Hence $gU \subseteq U$.
Similarly, we have $g^{-1}u \in U$, so $u \in gU$ and hence $U \subseteq gU$.