Though you can create unlimited number of labels, however Google enforces some limitation on the script execution time as following-:
1. Personal @gmail account OR Google Workspace Basic edition users have a limit of 6 minutes for script execution, that means script for you can run maximum for 6 minutes.
Though I have not tested but You should be able to create upto 100 Gmail labels at once.
2. Google Workspace Business, Enterprise or Education edition users have a limit of 30 minutes for script execution time, that means script for you can run maximum for 30 minutes.
Though I have not tested but You should be able to create upto 300 Gmail labels at once.
What if you need to create more than that, like 1000 Gmail labels at once?
You can create them in small batches instead of putting all 1000 at once.