In addition to Brick's answer, I think (looking at the comments) it will be worthwhile to motivate the appearance of the phase of the wave and why it is precisely this quantity (or a scalar multiple thereof) that we would expect to satisfy the Hamilton-Jacobi equation (HJE) in the classical limit.
It is helpful to compare the situation to the theory of electromagnetic waves. Here, light is fundamentally an electromagnetic wave and light propagation is a priori described within the theory of wave propagation. However, in certain regimes (the 'geometric optics limit') it is possible to describe the propagation using the notion of light rays that have particle-like trajectories. These rays correspond to the movement of individual 'points' on the wavefront of the wave, moving at all times perpendicular to the wavefront. Roughly speaking, such an approximation is valid whenever interference effects can be neglected.
The latter is of course precisely what we aim to do in the classical limit of QM. The wavefunction represents a wave, and in the classical limit we would like to identify the motion of an individual point on the wavefront with the motion of a classical particle, neglecting interference effectes. The classical limit of QM in this sense can thus be thought of as a kind of geometric optics limit. In fact, it was through reverse engineering this analogy that Schrödinger came up with his equation.
So the question is: given a wavefunction $\psi(\vec x,t)$, how do we obtain the motion of an individual point on its wavefront, i.e. the trajectory of a 'ray' of the wave? In analogy with the standard geometric optics limit, we assume the wavefunction to be of the general form
$$\psi(\vec x,t) = A(\vec x,t)e^{i B(\vec x,t)},$$
where $A(\vec x,t), B(\vec x,t)$ are both real and $A(\vec x,t)$ is slowly varying so that the latter may be treated effectively as a constant. This ansatz essentially says that we have a wavepacket centered around a single frequency. Since $A\approx $ constant, the wavefronts (surfaces of constant amplitude) are given by $B(\vec x,t) = $ constant. This is where the phase appears.
Now, in the HJ formulation of classical mechanics it is a well-known fact that the trajectories of a classical particle with Hamiltonian $H$ can be thought of as the rays (as in the EM analogy) of some corresponding time-evolving surface or 'wavefront', namely the surface $S(\vec x,t)=$ constant, where the function $S$ satisfies the HJE with the corresponding Hamiltonian. This suggests a correspondence $B\leftrightarrow S$, up to a possible rescaling (note that any scalar multiple of $B$ has the same level sets $B=$ constant).
Indeed, all of this means that in order to show that the Schrödinger equation with Hamiltonian $H$ reduces in the classical limit to Hamilton's equations with Hamiltonian $H$ (for the trajectory of the 'ray', interpretted as particle), it suffices to show that in the limit, $B$ or rather some scalar multiple of $B$ satisfies the HJE with the same Hamiltonian.
And that is what is nicely done in Brick's answer: it turns out that $S=\hbar B$ does the trick, justifying the conventional notation $\psi \sim e^{i S/\hbar}$.