This is a subtle point that is made difficult to understand by inconsistent notation in a lot of the literature. We define two quantities:
- The canonical momentum $\mathbf{p}$, which is the conjugate variable for position, defined with $p_i=\partial L/\partial \dot{x_i}$. In classical mechanics, it is an abstract quantity that indicates a phase space coordinate. In quantum mechanics, the equivalent (though not identical, as elucidated here) definition is more helpfully phrased as "canonical momentum is the generator of translation;" this statement becomes somewhat more digestible when one considers a derivation (of the variety shown here) of its form in the position representation, $-\mathrm{i}\hbar\nabla$ . Notice that there is no immediately obvious connection between this definition and the time over which a body translates (i.e. the speed of the body).
- The kinetic momentum $\vec{\pi}=m\dot{\mathbf{x}}$, which is intuitively visualized a scalar multiple of the rate of change of position in classical mechanics and the rate of change of position expectation value in quantum mechanics. Its form as an operator in quantum mechanics is not immediately obvious from this description, but we can define the kinetic energy operator as $\hat{T}=|\vec{\pi}|^2/2m$; you may appeal to your classical intuition to convince yourself that this is the right definition of $\hat{T}$.
With these definitions speicified, we may consider cases where the concept of "momentum" appears, and decide which definition is implied:
In a number of cases, the potential is independent of $\dot{\mathbf{x}}$. Then, the Lagrangian is $L=T(\dot{\mathbf{x}})-V(\mathbf{x})$. The canonical momentum is given by $p_i=\partial L/\partial\dot{x}_i=\partial T/\partial\dot{x}_i=m\dot{x}_i$. This is the implicit assumption when one uses $-\mathrm{i}\hbar\nabla$ as the momentum operator in the Schrödinger equation or when calculating expectation values; the intent is to refer to kinetic momentum, but they happen to be equal.
In the case of a charge in an electromagnetic field, the assumption that the potential is independent of $\dot{\mathbf{x}}$ is incorrect, so the canonical and kinetic momentum are no longer equal. Specifically, if one writes down the Lagrangian$$L=\frac{1}{2}m\dot{\mathbf{x}}^2-q(\phi-\dot{\mathbf{x}}\cdot\mathbf{A}),$$ which, when inserted in the Euler-Lagrange equation, gives the Lorentz force equation $m\ddot{\mathbf{x}}=q(\mathbf{E}+\dot{\mathbf{x}}\times\mathbf{B})$, and differentiates that with respect to $\dot{x}_i$, the result is the canonical momentum $p_i=m\dot{x}_i+qA_i$, but the kinetic momentum is unchanged, $\vec{\pi}=m\dot{\mathbf{x}}$. In such cases, one would eventually use the kinetic momentum, expressed as $\vec{\pi}=\mathbf{p}-q\mathbf{A}$, when calculating expectation values or solving the Schrödinger equation, but the Hamiltonian$$H=\frac{1}{2m}|\mathbf{p}-q\mathbf{A}|^2+q\phi$$is actually arrived at using $H=\dot{\mathbf{x}}\cdot\mathbf{p}-L$. Moreover, if you try to find the expectation value of the canonical momentum for a valid state, you may end up with a gauge-dependent answer, which is not problematic because the canonical momentum is not an observable quantity, unlike the kinetic momentum (the expectation value of which will be gauge-invariant).