That's only a free particle case, but since many systems can approximate free particles to some degree, it might retain some more general validity. For something to have a definite momentum, it has to have a wave function in position basis (i.e., a function of position) that is an eigenfunction of the operator -i hbar d/dx. Eigenfunctions like that yield p times the eigenfunction when you plug them through the operator, so the x dependence is ei hbar p x for p in the x direction. Since k is normally defined as ei k x, that will be the same as your expression, but only for states of definite momentum. Those are also called free particle states because they are also energy eigenfunctions when there is no potential energy (the particle is free). I suppose you could prepare a particle in a state of definite momentum even in the presence of a potential energy, but it wouldn't maintain that definite momentum because it would evolve into indeterminate momentum, so the p relation wouldn't mean much if the particle were not acting like a free particle.