A lot depends on what type of merchant ship you commanded.
From 1818, the famous Black Ball line introduced a packet service between New York and Liverpool. The packets averaged 23 days for the voyage eastwards and 40 days for the voyage westwards. A packet sailed on the 1st of every month from New York, and on the 5th from Liverpool. (Until 1822, when two sailings per month in each direction were initiated). The line originally had four ships. So, in general, one ship would be sailing east, one ship sailing west, one ship loading/unloading in Liverpool, one ship loading/unloading in New York.
On the original schedule, if you made the crossing in average time, you would have spent about 6 weeks in port every time you were in Liverpool, and 3 weeks in port every time you were in New York.
This would have changed as the schedule and size of the fleet changed.
If your ship was not a packet (sailing on a schedule) (packet service became more and more common as the century progressed, and more pairs of ports became connected by packet services), then the amount of time you were in port would be dictated by the time it took to unload your cargo, the time it took to find an economical quantity of cargo for the next voyage, and the amount of time it took to load the cargo. How long it took to find a cargo would be the most unpredictable variable.
Roughly once a year, there might be a longer time in port while the ship was hauled or careened to scrape fouling off the bottom and conduct general maintenance.