Here is a summary of my comments:
This depends on what exactly “$U^\ast U = UU^\ast = I$” means. The first possible interpretation is that $I$ must be $I_H$, i.e., the identity operator defined on the entire space. This implicitly implies that both $U$ and $U^\ast$ are everywhere defined, in which case $U$ must be bounded (see, for example, this or this answer of mine) and thus a unitary.
The second possible interpretation is that $U^\ast U = I_{D(U)}$ and $UU^\ast = I_{D(U^\ast)}$. This is also enough to imply $U$ is bounded - in fact, the first equation alone is enough to imply $U$ is an isometry. Indeed, for any $h \in D(U)$, one then have $\|Uh\|^2 = \langle Uh, Uh \rangle = \langle h, U^\ast Uh \rangle = \langle h, h \rangle = \|h\|^2$, where in the second equality we have used the fact that $h \in D(U) = D(I_{D(U)}) = D(U^\ast U)$. Thus, $U$ extends to an isometry defined on the entirety of $H$, so the closure of $U$, $\overline{U}$, is an isometry. $U^\ast = \overline{U}^\ast$ is everywhere defined, so $UU^\ast = I_{D(U^\ast)} = I_H$ implies $U^\ast$ is both an isometry and a co-isomery, i.e., a unitary. In fact, this also implies $U$ is everywhere defined, as $U^\ast$ is a unitary, so if $U$ were not everywhere defined we could not have had $UU^\ast = I_H$. Thus, $U$ is a unitary in the first place, without even requiring extensions.
The third possible interpretation is that $U^\ast U = I_{D(U^\ast U)}$ and $UU^\ast = I_{D(UU^\ast)}$. This is somewhat more complicated. In case $U$ is closed, the first equation is still enough to imply $U$ is bounded. This is because, when $U$ is closed and densely defined, $U^\ast U$ is densely defined as well (see, for example, Proposition X.4.2 in Conway's "A Course in Functional Analysis"). Then for $h \in D(U^\ast U)$, using the same argument as in the second case, we can still get $\|Uh\| = \|h\|$. So $U$ is isometric on a dense subspace of $H$, whence by its closedness it must be an everywhere defined isometry. Then $UU^\ast = I_{D(UU^\ast)}$ implies $U$ is a unitary.
I don't know what happened when $U$ is just assumed closable - my assumption is that $D(U^\ast U)$ may not be dense and $U$ may not be bounded, but I can't construct an example at the moment. When $U$ is not necessarily closable, however, there are counterexamples. In an extreme case, we can construct an injective $U$ that is everywhere defined but $D(U^\ast) = \{0\}$, in which case we trivially have $D(U^\ast U) = D(UU^\ast) = \{0\}$ and $U^\ast U = UU^\ast = I_{\{0\}}$. To construct such an $U$, we first prove that,
Lemma: Let $H = \ell^2$. Then there is a linearly independent subset $\{f_\kappa\}_{\kappa < \mathfrak{c}} \subset H$ which is dense in $H$. Here, $\mathfrak{c}$ is the cardinality of continuum.
Proof: Fix a bijection $\pi: \mathfrak{c} \to H \times \mathbb{N}$ and write $\pi(\kappa) = (h_\kappa, n_\kappa)$ for each $\kappa < \mathfrak{c}$. Proceed by induction. For each $\kappa < \mathfrak{c}$, suppose $f_\lambda$ for all $\lambda < \kappa$ has been chosen. Since $\ell^2$ has Hamel dimension $\mathfrak{c}$ (see, for example, this paper), $\text{span}\{f_\lambda\}_{\lambda < \kappa}$ is a proper subspace of $H$. Hence, it has no interior. Thus, the open ball $O_\kappa$ of radius $\frac{1}{n_\kappa}$ around $h_\kappa$ contains a point outside $\text{span}\{f_\lambda\}_{\lambda < \kappa}$. Let $f_\kappa$ be this point. It is then easy to see that $\{f_\kappa\}_{\kappa < \mathfrak{c}}$ is linearly independent and its closure is the entirety of $H$. $\square$
Now, let $H = \ell^2$, $\{e_\kappa\}_{\kappa < \mathfrak{c}}$ be a normalized Hamel basis of $H$, and $\{f_\kappa\}_{\kappa < \mathfrak{c}}$ be a linearly independent dense subset of $H$ given by the lemma above. Define $U(e_\kappa) = f_\kappa$ and extend by linearity. Since $\{f_\kappa\}_{\kappa < \mathfrak{c}}$ is linearly independent, $U$ is injective. To show that $D(U^\ast) = \{0\}$, recall that $v \in D(U^\ast)^\perp$ iff $(0, v)$ is in the closure of the graph of $U$ (a proof can be found on Wikipedia). For any $v \in H$ and $n \geq 1$, by density of $\{f_\kappa\}_{\kappa < \mathfrak{c}}$ there exists a $\kappa_{v, n} < \mathfrak{c}$ s.t. $\|f_{\kappa_{v, n}} - nv\| < 1$. Then,
$$\|U(\frac{1}{n}e_{\kappa_{v, n}}) - v\| = \frac{1}{n}\|f_{\kappa_{v, n}} - nv\| < \frac{1}{n}$$
So, $(\frac{1}{n}e_{\kappa_{v, n}}, U(\frac{1}{n}e_{\kappa_{v, n}})) \to (0, v)$ as $n \to \infty$. This shows $(0, v)$ is in the closure of the graph of $U$ for all $v \in H$, whence $D(U^\ast)^\perp = H$ and so $D(U^\ast) = \{0\}$.