Not in infinite dimension. Yes, of course, in finite dimension since every subspace is closed.
Take a nonzero, unbounded linear functional $\phi$ on your infinite-dimensional Hilbert space $H$. Take $x_0\in H$ such that $\phi(x_0)=1$. Then
$$
H=\ker \phi \oplus \mathbb{C}x_0\qquad x=(x-\phi(x)x_0)+\phi(x)x_0.
$$
Since $\mathbb{C}x_0$ is finite-dimensional, it is closed. And since $\phi$ is unbounded, $\ker \phi$ is not closed.
Notes:
To "construct" such a $\phi$, take $\{e_n\}$ an infinite orthonormal set in $H$ and set $\phi(e_n):=n$. Extend by linearity to $\mbox{span}\{e_n\}$. Then extend to any algebraic complement of $\mbox{span}\{e_n\}$ by $0$.
If $H=F\oplus G$ is an orthogonal direct sum of any two subspaces of $H$, though, then both $F$ and $G$ must be closed and we have $F=G^\perp$ and $G=F^\perp$.