It is not always true that eigenfunctions of self-adjoint operators form a Hilbert basis (or a complete orthonormal system if you prefer).
Before addressing this point, let me first address your second question. Suppose $\mathscr{H}$ is a complex Hilbert space. In functional analysis, a linear operator $T$ is said to be bounded if there exists a constant $C \ge 0$ such that:
$$\|T\psi\| \le C\|\psi\| \tag{1}\label{1}$$
holds for every $\psi \in \mathscr{H}$. As it turns out, most of the usual self-adjoint operators in quantum mechanics are not bounded. As a consequence, these cannot be everywhere defined due to the famous Hellinger-Toeplitz Theorem. This is what is basically happening in the case one uses the Laplacian operator on $L^{2}(\mathbb{R}^{d})$. As a matter of fact, unbounded linear operators are defined on dense subspaces of the underlying Hilbert space $\mathscr{H}$. An appropriate dense domain for the Laplacian operator, for instance, is $\mathscr{S}(\mathbb{R}^{d})$ the space of rapidly decreasing functions.
Let me get back to your first question now. Suppose $T$ is a densely-defined (possibly unbounded) linear operator on $\mathscr{H}$. In linear algebra, linear operators were just matrices and their spectrum were just their eigenvalues. In the case of operators on infinite-dimensional Hilbert spaces, the spectrum is more than just eigenvalues. In fact, the spectrum of $T$, denoted by $\sigma(T)$, is the set of all $\lambda \in \mathbb{C}$ for which $(T - \lambda \operatorname{Id})^{-1}$ fails to be a bounded linear operator. Hence, $\lambda \in \sigma(T)$ if, and only if one of the following conditions hold:
$T-\lambda \operatorname{Id}$ is not invertible, in which case $\lambda$ is called an eigenvalue of $T$.
$T-\lambda \operatorname{Id}$ is invertible (injective) and its range is dense in $\mathscr{H}$, but its inverse is not bounded.
$T-\lambda \operatorname{Id}$ is invertible but its range is not dense in $\mathscr{H}$.
The set of eigenvalues of $T$ is denoted by $\sigma_{p}(T)$. The set of all $\lambda \in \mathbb{C}$ satisfying property 2. is denoted by $\sigma_{c}(T)$ and the latter is referred to as the continuous spectrum of $T$. Analogously, the set of all $\lambda \in \mathbb{C}$ satisfying property 3. is denoted by $\sigma_{r}(T)$, the so-called residual spectrum of $T$. Consequently, one gets $\sigma(T) = \sigma_{p}(T)\cup \sigma_{c}(T)\cup \sigma_{r}(T)$. It is possible to prove that if $T$ is self-adjoint then $\sigma_{r}(T) = \emptyset$ and $\sigma(T) = \sigma_{p}(T)\cup \sigma_{c}(T)$.
Now, in your case $\mathscr{H} = L^{2}(\mathbb{R}^{3})$ is a very special Hilbert space: it is separable in the sense that it has a countable Hilbert basis. In quantum mechanics, the Hilbert spaces are usually separable.
When a self-adjoint operator $T$ on a separable Hilbert space has only eigenvalues in its spectrum, that is, when $\sigma_{c}(T) = \emptyset$, then one can find a Hilbert basis of eigenvectors of $T$.
Finally, when one tries to solve the Schrödinger equation, one usually looks for separable solutions. This is why we first solve the time-independent Schrödinger equation $H\psi = E\psi$ or, in other words, we obtain the eigenvalues of $H$. When $H$ has "discrete spectrum", that is, only eigenvalues in its spectrum, then their eigenvectors form a Hilbert basis as claimed before and every other vector can be expanded in terms of this basis. This is what you obtained in the case of an infinite square well. When $\sigma_{c}(T)$ is not empty, however, things get a little more complicated, but one can still look for solutions of the Schrödinger equation which serve as a complete orthonormal system in a generalized way, e.g. by means of Fourier transforms. This is what happens, for instance, when we solve the free particle Schrödinger equation.