The US Congress passed legislation that allowed the “In God We Trust” inscription on the currency.

The inscription was added to one-cent and two-cent coins. The legislation is known as the Coinage Act of 1864.

Source