It became the official motto on July 30, 1956, when U.S. Pres. Dwight D. Eisenhower signed the legislation. The move came during the Cold War when the United States wanted to differentiate itself from the atheist Soviet Union.
Previously, the unofficial motto had been E pluribus unum (Latin for āout of many, oneā)