Normal merchant generation happens at the start of each month: a country will either gain no merchant that month, or it will gain one. If you hover over the merchant icon at the top of the screen, you'll get a tooltip showing the yearly number of merchants your country gets, and the breakdown according to the following factors:
|-3 to +3||Stability||your stability|
|+1||Coastal Provinces||+1 if you own at least one port city on your home continent.|
|+1 to +3||Protestant Coastal Provinces||+0.5 for each home continent port city which is of the Protestant or Reformed religions. Maximum of +3.|
|+2 to -2||Domestic Policies||+2 - 0.4*mercantilism|
|+1 or +2||Trade Level||+1 if trade tech is 5 to 9; +2 at trade tech 10|
|+1/CoT||Centers of Trade||+1 per center of trade owned|
|+1/monopoly||Monopolies||+1 per monopoly you have|
There is a maximum rate of 12 merchants/year (1 per month).
It is also possible to gain merchants via events. A few countries have scripted events which give them merchants. There is also the Rush of Merchants random event and several others that give merchants in random events.