This follows from non-dimensionalisation or scaling - the removal of units from an equation involving physical quantities. In the case of the wavefunction, this is done through the following substitution:
\begin{equation}
x = x_{c} \tilde{x}\\
\frac{d}{dx} = \frac{d\tilde{x}}{dx} \frac{d}{d\tilde{x}} = \frac{1}{x_c} \frac{d}{d\tilde{x}}
\end{equation}
where $x_{c}$ is an intrinsic characteristic unit (length) of the system and $\tilde{x}$ is the nondimensionalized counterpart of $x$. Additionally, $\psi(x) = \psi( x_{c} \tilde{x} ) = \tilde{\psi}(\tilde{x})$. After a substitution the Schrödinger equation becomes:
\begin{equation}
\left(-\frac{\hbar^2}{2m}\frac{1}{x_c^2}\frac{d^2}{d\tilde{x}^2} + m\omega^2 x_{c}^{2} \tilde{x}^{2} \right) \tilde{\psi}(\tilde{x}) = E \tilde{\psi}(\tilde{x})
\end{equation}
After dividing by the coefficients in front of the largest term, we get:
\begin{equation}
\left(-\frac{d^2}{d\tilde{x}^2} + \frac{m^{2} \omega^{2} x_{c}^{4}}{\hbar^2} \tilde{x}^{2} \right) \tilde{\psi}(\tilde{x}) = \frac{2mE x_{c}^{2}}{\hbar^2} \tilde{x}^{2} \tilde{\psi}(\tilde{x})
\end{equation}
To make the terms dimensionless we equate the coefficients to unity:
\begin{equation}
\frac{m^{2} \omega^{2} x_{c}^{4}}{\hbar^2} = 1 \implies x_c = \sqrt{\frac{\hbar}{m\omega}}\\
\frac{2mE x_{c}^{2}}{\hbar^2} = \frac{2mE \hbar}{\hbar^2 \omega} = 1\implies E= \frac{\hbar \omega}{2} \tilde{E}
\end{equation}
From the above equations we find that the characteristic units of energy and length of the Harmonic oscillator are, $\hbar \omega$ and $\sqrt{\frac{\hbar}{m \omega}}$ , respectively. The unit free version of the time-independent Schrödinger equation for the quantum harmonic oscillator becomes:
\begin{equation}
\left(-\frac{d^2}{d\tilde{x}^2} + \tilde{x}^2\right) \tilde{\psi}(\tilde{x}) = \tilde{E} \tilde{\psi}(\tilde{x}) \text{ or } \frac{d^2}{d\tilde{x}^2} = (\tilde{x}^2 - \tilde{E}) \tilde{\psi}(\tilde{x})
\end{equation}