The currency in this game is doubloons (dbl), for which you can buy and sell almost anything. You will mostly get money from looting ships at sea, but you can also sell your goods, gamble for it, fight at the bar or just old plain working.
There is a banking system in this game. When you lose a battle at sea, you will lose all your doubloons, no matter how many ships you've got. It would be impossible to achieve anything if you couldn't save it in a safe place.
You have a bank account that you can put your money into and out of no matter which nation you are in. If you put in 100 dbl in Panama, you can take it out in Port Royale without any trouble.
It's recommended to only have cash when you are in a town, for buying and selling. Before you leave, you should put the rest in your account. There is however a small tax of 5 %. If you put in 100 dbl, you can only get 95 dbl back.
You can also take a loan if the game are tough on you. You have to pay a rent of 15 % if you do so, and you cannot loan more than 11 500 dbl. The usual reason to take a loan is when you haven't saved anything in your account and loses a fight at sea.