Linear combination of eigenstates in a potential Linear combination of a set of vectors is only defined for a finite set of vectors even though the set might be an infinite set. In quantum mechanics we take infinite linear combination of all possible energy eigenstates for any bound state problem like the harmonic oscillator spectrum. How is this justified even after linear combination is defined for only finite set of vectors.
Various problems might arise. The infinite linear combination might not always converge.
 A: One can define linear combinations  for the infinite-dimensional spaces, but the notion is different to that used for finite-dimensional spaces.   In particular, in  quantum mechanics we use  convergence using the  $L^2[\mathbb R]$ norm as measure of distance of how close one function gets to another.  If $\psi(x)$ is an element of   $L^2[\mathbb R]$ -- i.e. a function such that 
$$
\|\psi\|_2^2 \equiv \int_{-\infty}^{\infty} |\psi(x)|^2 dx <\infty
$$ and, for example, if  $\varphi_n(x)$ $n=1,2,\ldots \infty $ is a complete set of $L^2[\mathbb R]$ eigenfunctions of a self-adjoint (roughly "Hermitian") operator, then the spectral theorem for self-adjoint operators always allows us to  expand 
$$
\psi(x)= \sum_{n=1}^{\infty} c_n \varphi_n(x), \quad c_n= \langle \varphi_n\vert \psi\rangle
$$ with convergence  guaranteed  in the sense that
$$
\lim_{N\to \infty } \| \psi - \sum_{n=1}^N c_n \varphi_n\|_2\to 0.
$$
Convergence is guaranteed only in this integrated-over-all-$x$   sense.  Pointwise convergence i.e. 
$$
\lim_{N\to \infty} | \psi(x) - \sum_{n=1}^N c_n \varphi_n(x)| \to 0, \quad \forall x\in \mathbb R,
$$
is not guaranteed.  When the eigenfunctions are not in $L^2[\mathbb R]$, i.e. not normalizable, then the sum over $n$ has to be replaced by an integral (as in a Fourier transform), but the sense of convergence is the same.
The problem with  finite dimensional vector spaces is that they do not come equipped with a norm, so the notion of convergence is not defined. As a consequnce  we are restricted to finite sums in linear combinations. 
A: The linear combination in question will always converge.
This is because any particular eigenstate $\phi_n(x)$, to be a physical wavefunction, needs to be square-integrable. Hence $\phi_n(x) \rightarrow 0$ as $x \rightarrow \pm \infty$.
Therefore, the total wavefunction $\psi = \sum_{n} c_n \phi_n$ will also obey the property that $\psi(x) \rightarrow 0$ as $x \rightarrow \pm \infty$.
In the specific case of the harmonic oscillator, the series solution is terminated by hand in order to avoid infinite terms in the expansion, which would make the solution physically meaningless. See what they say below eq. 21 here.  This truncation is the physical origin of the quantised energy spectrum in the harmonic oscillator.

Fun fact.  Quantisation of energy levels in quantum mechanics arises from requiring that the wavefunction has a physical meaning. 


*

*In the (infinite or finite) square well, the quantisation arises from the bounday conditions {$\psi $ continuous} and {$\frac{\mathrm{d}\psi}{\mathrm{d}x}$ continuous}, which are just ensuring that momentum ($\hat{p} \propto \nabla$) and energy ($\hat{H} \propto \nabla^2$) are single valued and finite.

*In the harmonic oscillator, the quantisation arises from truncating the series solution, in order for the wavefunction to converge and be finite.
