"I suddenly knew that I loved her."
Translation:Mi subite sciis, ke mi amas ŝin.
It follows the same rule as indirect quoting, which follows the same rule as direct quoting. Compare:
Mi diris, "Mi amas ŝin."
Mi diris, ke mi amas ŝin.
Tiam mi sciis, ke mi amas ŝin.
In Esperanto, the tense of the subordinate clause doesn't get mutated to match what the main clause is doing, as it does in English. If you were to push the verb into the past tense, that would be taken literally.
Li diris, ke li amis ŝin = He said that he had loved her.