In QM you have a general postulate, that requires physical observables (momentum, angular momentum, coordinates) to be represented by Hermitian operators. Actually, in QM you have different bases as well as different notion of time evolution. Those are position and coordinate basis and Schrödinger and Heisenberg representations. Where the difference between the last two is that in the Heisenberg picture operators are time dependent. Your question is for the Schrödinger representation coordinate basis so lets concentrate on it.
In the coordinate representation, the basis is formed by an infinite set of vectors $\{| {\bf x} \rangle\}$ for which the following holds:
$$
\hat{\bf X}| {\bf x} \rangle = {\bf x} | {\bf x} \rangle
\,.
$$
Every state vector $| \psi \rangle$ can be expressed in this basis as:
$$
| \psi \rangle = \int d{\bf x} \, |{\bf x}\rangle \langle{\bf x}|\psi\rangle
\,,
$$
where we used the usual expression $ \int d{\bf x}|{\bf x}\rangle \langle{\bf x}|=\hat{I}$.
So the position operator was easy, what about the momentum operator? Here you need more calculus.
Similarly, for the momentum representation we have:
$$
\hat{\bf P}| {\bf p} \rangle = {\bf p} | {\bf p} \rangle
\,,
$$
and
$$
| \psi \rangle = \int d{\bf p} |{\bf p}\rangle \langle{\bf p}|\psi\rangle
\,.
$$
To relate the two we note:
$$
\psi({\bf x})=\langle{\bf x}|\psi\rangle=\int d{\bf p} \langle{\bf x}|{\bf p}\rangle \langle{\bf p}|\psi\rangle=\int d{\bf p} \langle{\bf x}|{\bf p}\rangle\phi({\bf p})
\,,
$$
which means that you go from one base to the other via a Fourier transformation. Where the Fourier transform is given by:
$$
\psi({\bf x})=\frac{1}{(2\pi \hbar)^{\frac{2}{3}}}\int d{\bf p}\,e^{\frac{i{\bf x}\cdot{\bf p}}{\hbar}}\,\phi({\bf p})
\,.
$$
In this base, for the momentum operator $\hat{\bf P}$, we have:
$$
\langle {\bf x}|\hat{\bf P}|\psi\rangle
=
\langle{\bf x}|\hat{\bf P}
\int d{\bf p}|{\bf p}\rangle \langle {\bf p}
|\psi \rangle
=
\int d{\bf p}
\langle{\bf x}|\hat{\bf P}|{\bf p}\rangle
\phi({\bf p})
=
\int d{\bf p} \,
{\bf p}\langle{\bf x}|{\bf p}\rangle \,
\phi({\bf p}) \\
=
\frac{1}{(2\pi \hbar)^{\frac{2}{3}}}\int d{\bf p}\,
{\bf p} \, e^{\frac{i{\bf x}\cdot{\bf p}}{\hbar}} \phi({\bf p})
\,,
$$
since
$$
-i\hbar {\boldsymbol \nabla} e^{\frac{i{\bf x}\cdot{\bf p}}{\hbar}}
={\bf p}\,e^{\frac{i{\bf x}\cdot{\bf p}}{\hbar}}
\,,
$$
we have:
$$
\langle{\bf x}|\hat{\bf P}|\psi\rangle=-i\hbar {\boldsymbol \nabla} \langle {\bf x} | \psi \rangle
\,.
$$
Or simply, $\hat{\bf P}=-i\hbar {\boldsymbol \nabla}$, and for the other operator, $\hat{\bf X}| {\bf x} \rangle = {\bf x} | {\bf x} \rangle$, by definition, because we are working in the coordinate basis.
You can easily check that both $\hat{\bf P}$ and $\hat{\bf X}$ are hermitian and satisfy the Heisenberg relation.
P.S. You can have also the Dirac (interaction) picture where both states and operators depend on time.