While I have found that the first naval battle including ship mounted cannon occurred in 1338. It would seem that the use of such weapons did not turn the tide of the battle. Further reading brought me to the assertion that the 16th century saw the change to gunpowder enabled naval artillery and not hand to hand tactics. Understandably, this change in weaponry would require a change in tactics and in skill for the combatants. Now, where and when were these changes pioneered by the formation of specialized schools, colleges or centers of research and learning? Or was this new technology handed down in an apprenticeship type fashion by those who hadn't blown their limbs off learning how to do it?
Military knowledge like this was considered highly secret and valuable and was not originally taught in schools, but Phillip II (1556-1598) saw the strategic value of cannon and greatly expanded artillery education. Originally most ships were privately owned and kings would put together fleets only temporarily for specific purposes. For example, when Columbus sailed, the ships and crew were all private and the king hired them specifically for that just that one mission. The arming of a ship was typically arranged by the shipmaster.
The first galleons with cannons were Portuguese and Spanish and were known in the 1530s or even earlier. In some cases these were ships of the crown, being permanently owned by the king and operated by his officers. To make a fleet a king might have a small core of royal ships and then private ships would be hired to round out the fleet in the case of war.
Training in artillery was the same for both ships and the field, so in the beginning, the artillery men would just load onto the ship, not being sailors at all and have to learn how to be a seaman quickly. The Spanish are known to have had artillery schools early on at Burgos, Barcelona and Gibraltar established by Phillip II. In 1575, Phillip II instructed the Council of the Indies to create an artillery school at the Casa de la Contratacion in Seville. This school became very important and led developments. The school at Barcelona was also very important also because there was a large cannon foundry in Baracelona.
The foundation of the school in Seville is well known. For example, you can refer to:
"Ordenanzas Reales, para La Casa De La Contratacion de Sevilla, Y Para Otras cosas de las Indias, y de la navegacion y contractacion de ellas." (1647)
I cant answer for every country but for Britain, the move to formal education of naval gunnery officers came fairly late. The Royal Artillery College at Woolwich had been established in 1741 to train army officers in the necessary sciences. By comparison, the Royal Navy first established their gunnery school (known as HMS Excellent) as late as 1830.
Brian Lavery in "Nelson's Navy" (Conway Press, 1989) says, of officers during the French Revolutionary & Napoleonic Wars,
"Army artillery officers were highly trained in ballistics at Woolwich, but naval officers, though not entirely unschooled in mathematics, had little idea of scientific gunnery. Ballistics formed no part of the lieutenant's examination, and a ship's gunners were not expected to have any mathematical or scientific knowledge"
Prior to the establishment of HMS Excellent, gunnery was something that was learned on the ship, and thanks to almost constant wars in the 18th century, it was something that they had plenty of practice at. There was no service-wide system of gunnery training or drills. The amount of training that was performed was dictated by the individual ship's captains. As a result the standard of gunnery could vary greatly from ship to ship.
The War of 1812, in particular, highlighted the shortcomings of this approach, and it was thanks to the experiences and criticisms of officers such as Philip Broke (of HMS Shannon) that the naval gunnery school was finally established.