Yes, the number of products in Magento 2 store affects the time of migration.
The Magento 2 migration process duration depends not only on the number of products but the complexity of the store including the number of customers, orders, categories, and CMS pages as well as the customization.