At least as a secondary, more likely tertiary option, ramming remained even into the era of iron- or steel-constructed ship up to the "Dreadnought"-era. That's why the prows, in contrast to the clipper-ship-like raked
bows of later warships (from the 1930's on?) were longer at the water line than at the main deck. Even the lead ship of the "all-big-gun" battleships, the HMS Dreadnought of 1906, still showed this
bow form. In fact, the first capital ship of the Royal Navy with a somewhat raked bow might have been the battle cruiser HMS "Hood" of 1920. As per my 1997 German translation of the 1996 HarperCollins book "Jane's Battleships of the Twentieth Century", the bow form probably owed more to hydrodynamic considerations and certainly wasn't chosen with the view to ramming an opponent - the range of the main artillery had reached distances at which opponents could only be made out by huge optical targeting systems, or later, especially useful in bad weather obscuring optical systems, by radar.
It did not "remain". Rather, it came back. During the Middle
Ages, as I said, ramming was still used in galley warfare, but only for the purposes of boarding, not of trying to sink
ships. Byzantine dromonds had a raised prow for boarding, and we see ramming-to-board being used as late as the Battle of Lepanto in 1571. But in the Atlantic, where cogs and later caravels and carracks were used (galleys not being all that suitable for oceanic warfare), boarding was done by bringing ships alongside each other and using grappling hooks. As artillery advanced, boarding became ever rarer, and by the 17th century warships largely did away with the
towers that were used to provide elevated platforms to support marines, gradually transitioning into artillery-primary
ships of the line and similar gun warships. This process happened in the Mediterranean too, though it took slightly longer.
This artillery focus would remain for a long time. Boarding actions still happened with regularity - many goood examples at the Battle of Trafalgar! - but it was rarely decisive and never the first option. Battle was typically won or lost in a cannon duel, with boarding - if it happened at all - being merely a formal seal on the already decided outcome. This would only change with appearance of ironclads (
Nemesis, 1839). But it was only in late 1850s that ironclads began appearing in numbers along with appearance of ocean-going ironclads (
Gloire, 1857) and by 1862, ironclads had been adapted en-masse by European navies. Year of 1862 also marked the first appearance of ironclads in the US as well as the first ironclad-on-ironclad battle (
CSS Virginia vs
USS Monitor, 1862).
For a period of time,
armor had significant advantage over the available artillery.
USS Monitor and
CSS Virginia spent hours pounding each other into scrap metal... with only success being creating a lot of noise. Neither could sink each other:
Monitor had no ramming beak, and
Virginia had left her own in the side of
USS Cumberland, and in any case was about as agile as a beached
whale. This impotence of artillery was seemingly confirmed in the Battle of Vis in 1866, where even wooden warships managed to stand up to modern guns, though with significant damage. Battle of Vis was the first (and I believe last) major naval battle between ironclad warships, and also the first naval battle of modernity to feature numerous cases of deliberate ramming. Reason was simple: armor of the time made naval artillery nearly useless, and so ramming and boarding were the only viable options for taking out enemy ironclads. Austrian flagship
Erzherzog Ferdinand Max rammed and sank Italian ironclad and de-iure flagship
Re d'Italia and also rammed
Palestro, which later exploded as a result of fire onboard caused by artillery fire from armored frigate
Drache.
This battle seemingly confirmed importance of ramming, and battleships for a long time continued to be built with a ramming prow, causing some rather hilarious incidents. By the late 19th century however improvements in gunnery meant that warships did away with actual rams. Ramming prow profile remained however as it was discovered that
the ram had acted much like bulbous bow does in modern ships, significantly decreasing water resistance at speed. Looking at
profile of HMS Dreadnought, it is clear that she did not actually have a
ram: ramming bow form was there for reasons of hydrodynamics, not tactics.
As I understand it, ramming well out of favour earlier, as by the Hellenistic period heavy projectile
weapons meant that the rammer was more likely to be disabled by the rammed before it was actually rammed. Projectile weapons needed large, stable platforms for accuracy, and crews to match. The Mediterranean becoming a roman lake after the defeat of the Ptolemies meant that such large ships (and their heavy armament) were no longer needed, smaller ships, relying on boarding became more effective for the anti-piracy tasks. The heavy, non gunpowder projectile weapons do not seem to have been reinvented in the Byzantine and Islamic periods
Depends on where. Carthaginians certainly focused heavily on ramming, otherwise Roman
corvus will not have been as successful as it apparently was. In Battle of Aegatas in 241 BC, Romans defeated Carthaginians through successful ramming attacks, whereas Roman Civil War
Battles of Mylae and of Naulochus in 36 BC were decided by boarding.
Rather than artillery, my quick reading would suggest that it were grappling hooks (which
technically could count as a form of artillery, being deployed from
ballistae) were what brought the end to primacy of ramming in naval warfare, at least in Roman times. If so, then there will have been little difference between late Republican, Imperial and Byzantine naval tactics, all of them being focused on boarding.