The Museum feature was introduced on October 18th, 2016.
The Museum building allows you to store unused ships in exchange for an XP reward, information about the ship, and a small coin bonus every few hours. You won't be able to use the ship again, but your ship count in the ranking will remain the same.
You can only add ships that are not currently in your fleet (unused). The ships also have to be upgraded to at least 5 stars. Ships that can be upgraded to 7 stars with gems do not have to be maxed out, they can also be stored in the Museum at 5 stars.
Placing a ship in the Museum will earn you a one-time XP bonus, which depends on the quality of the ship. How much XP any given ship earns you can be found on the Ships by level pages. You will also be able to read interesting information about the ship.
The Museum also functions as a production building, and produces a modest amount of coins for you. The coin production depends on the number of ships you have placed in the Museum. The quality of the ships in the Museum does not impact your coin production. To view the outputs of the Museum building at any given level, scroll down to the Upgrading section. You can collect coins once every hour, but the Museum will keep producing them for a lot longer than that (see production time). Once maximum amount has been reached, your Museum will not produce anymore coins until you collect them.
Tips
Buy low level event ships. The quality of the ships in the Museum does not influence the coin production. Some players like to buy low level event ships that they can easily upgrade, just to place them in the Museum and boost coin production. However, keep in mind that this will negatively impact the XP you get for each ship, because the XP reward does depend on the quality of the ship. Obviously, you should not spend gems on these low level ships. Also, make sure you have empty slots in your Museum before buying a bunch of ships.
Keep your exploration ships. Don't be too quick to put La Pensée (and similar ships) in the Museum. Many players swap those ships into their fleet to do explorations and for contracts that require sailors, and then remove them again.