Thiago Pereira of Brazil took the silver and Kosuke Hagino of Japan won the bronze.
American Michael Phelps finished fourth, ending his streak of Olympic success that had seen him win a record eight gold medals in Beijing four years ago.
The medal for Lochte was the first gold captured by the United States in these Olympics.
Moore to attend retreat in to avoid Kutcher's wedding
'How to Train Your Dragon 2' releases 5-minute clip