The fact that the energy should act as the generator of time translations is a fundamental postulate of the theory.
For starters, you couldn't even define $H$ to be $i\hbar \partial_t$ because $H$ must act on the Hilbert space $ \mathcal{H}$ whereas the former operator acts on curves defined on the Hilbert space, i.e. maps $t \mapsto |\psi(t)\rangle$.
The fact that $i\hbar \partial_t |\psi(t)\rangle = H|\psi(t)\rangle$ is one postulate where you say "I want energy to work as it should - the generator of time translations".
So there are two remaining questions: (i) why is that reasonable and (ii) what is $H$ in the end?
As for (i) this is the best guess you can have, because of prior experiences with Classical Mechanics. In Classical Mechanics, as you reformulate the theory from the Hamiltonian point of view you discover that energy can be fully characterized as the generator of time translations.
Knowing this you carry this over to QM and to Relativity as well. You might be used to the definition in relativity that given the four-momentum $p^\mu$ in a certain frame, the energy of the particle is defined to be $E = p^0$. This is exactly saying that it generates time translations.
In QM this takes the form of the Schrödinger's equation postulate: the energy will generate the time evolution, so that acting on a curve $|\psi(t)\rangle$ of states with $i\hbar \partial_t$ and computing at $t$ must coincide with acting on the ket $|\psi(t)\rangle$ for each fixed $t$.
Now let's get to (ii). Where do you get $H$ from? From the discussion above, $H$ must just be the operator characterizing the energy of the system. From the postulates of QM there are for each physical quantity one observable. Energy is a physical quantity and gets its observable. It is what $H$ is.
For systems with classical counterparts, that is, quantized systems, you get $H$ by first writing down the classical $H$ which you know from Classical Mechanics, and then making it quantum by replacing the classical variables by their quantum observable counterparts.
The traditional $H = \frac{\mathbf{p}^2}{2m}+V(\mathbf{r})$ Hamiltonian should be familiar from classical mechanics. Now momentum becomes in the quantum formulation the observable $P$ and position becomes the observable $\mathbf{R}$, then your quantum Hamiltonian is $ H = \frac{\mathbf{P}^2}{2m}+V(\mathbf{R})$.
For other systems you must know what energy is for that particular system. Once you know the right expression, you have the Hamiltonian, and it will act as should, generating time translations.