WASHINGTON—The U.S. Navy is preparing to deploy an experimental laser weapon to the Persian Gulf, where it could be used to deter Iran from using small boats to attack American warships.

Adm. Jonathan Greenert, the U.S. chief of naval operations, on Monday unveiled plans to place the laser cannon aboard a U.S. ship in the Gulf, where swarms of Iranian attack boats have posed a worrisome challenge for the American military.

The...