Nick here from Shopify. Great question!
You can set this in your store admin in the discounts section. If you take the following steps:
Discounts > Create discount code > Usage limits > tick the "Limit the number of times this discount can be used in total" box and then put 100 in.
You can see more about discounts and discount codes in general here.
How is your store going otherwise? What are you selling?