How is the hamiltonian a hermitian operator?

The general situation is the following one. There is a self-adjoint operator $H :D(H) \to \cal H$, with $D(H) \subset \cal H$ a dense linear subspace of the Hilbert space $\cal H$. (An elementary case is ${\cal H} = L^2(\mathbb R, dx)$, but what follows is valid in general for every complex Hilbert space $\cal H$ associated to a quantum physical system.)

It turns out that $D(H) = \cal H$ if and only if $H$ is bounded (it happens, in particular, when $\cal H$ is finite dimensional).

Physically speaking $H$ is bounded if and only if the values the corresponding observable (the energy of the system) attain form a bounded set, so it hardly happens in concrete physical cases. $D(H)$ is almost always a proper subset of $\cal H$.

If $\psi \in \cal H$ represents a (pure) state of the system, its time evolution is given by $$\psi_t = e^{-i \frac{t}{\hbar} H}\psi \tag{1}\:.$$ The exponential is defined via spectral theorem. The map $\mathbb R \ni t \mapsto e^{-i \frac{t}{\hbar} H}\psi$ is always continuous referring to the topology of $\cal H$. Moreover it is also differentiable if and only if $\psi_t \in D(H)$ (it is equivalent to say that $\psi \in D(H)$). In this case one proves that (Stone theorem) $$\frac{d\psi_t}{dt} = -i \frac{1}{\hbar} H e^{-i \frac{t}{\hbar} H}\psi= -\frac{i}{\hbar} H\psi_t\:.$$ In other words, $$i \hbar \frac{d\psi_t}{dt} = H\psi_t\:.\tag{2}$$ It should be clear that $\frac{d}{dt}$ is not an operator on $\cal H$, as it acts on curves $\mathbb R \ni t \mapsto\psi_t$ instead of vectors. $$\frac{d\psi_t}{dt} = \lim_{s \to 0} \frac{1}{s} \left(\psi_{t+s}-\psi_t \right)$$ and the limit is computed with respect to the Hilbert space norm. Identity (2) holds if and only if $\psi \in D(H)$ and not in general.

ADDENDUM.

Identities or even definitions (!) like $$H = i \hbar \frac{d}{dt}\:.\tag{3}$$ make no sense. An observable in QM first of all is an operator (self-adjoint) on the Hilbert space $\cal H$ of the theory. In other words it is a linear map $A$ associating any given vector $\psi \in \cal H$ (or some suitable domain) to another vector $A\psi$. If $\psi$ is a given single vector of $\cal H$ - and not a curve $t \mapsto \psi_t$ - the formal object $$\frac{d}{dt}\psi$$ has no meaning at all as it cannot be computed! Thus, wondering whether or not $H$, "defined" by means of (3), is Hermitian does not make sense in turn, because the RHS of (3) is not an operator in $\cal H$.

The concrete definition of $H$ can be given as soon as the physical system is known and taking advantage of some further physical principles like some supposed correspondence between classical observables and quantum ones, or group theoretical assumptions about the symmetries of the system.

For non-relativistic elementary systems described in $L^2(\mathbb R^3)$, the Hamiltonian operator has the form of the (hopefully unique) self-adjoint extension of the symmetric operator $$H := -\frac{\hbar^2}{2m}\Delta + V(\vec{x})$$ That is the definition of $H$.

Nevertheless, Schroedinger equation (2) is always valid, no matter the specific features of the quantum (even relativistic) system, when $\psi \in D(H)$. Time evolution is however always described by (1) regardless any domain problem.