Gun has replaced cannon in artillery for the most part....and guns used for artillery are considered to be 20mm or larger. Artillery is split into 2 classes Guns and Howitzers with Mortars being their own class. Guns are high velocity flat shooting, howizters are lower velocity (generally) with a more arcing shot for better indirect fire. The Navy has little need for Indirect fire USUALLY, hence they would use more weapons that would be classed as Guns under modern terminology. Guns tended to have longer range than Howitzers bore for bore size due to ballistics and better armor penetration against other ships, the Army on the other hand tends to employ more Howitzers as they need the indirect fire capabilities to shoot over hills, over defensive postions etc hence they use fewer Guns, though they did employ a number of them during the WW2 to Vietnam eras including the Nuclear Cannon and the 8" Self Propelled Gun aka 203mm SP Gun.
I don't always find Wikipedia to be the most accurate but the first few paragraphs of the link below pretty well describes why Cannon has mostly fallen out of use except for auto-cannons
.
https://en.wikipedia.org/wiki/Cannon