Out of the box, the gift card account is created automatically when the order is invoiced and paid. Since v. 2.18.0 of Gift Card extension it is possible to create gift code accounts and send gift card emails right after the order creation, along with automatic account deactivation on order cancellation. You can find the 'amasty/module-gift-card-subscription-functionality' package for installing in composer suggest. Please note that the module is available as a part of an active subscription.
In order to choose the order status that will trigger gift card code account creation and email sending, kindly navigate to Amasty > Gift Card > Configuration > Email Options > Send Gift Card Code Email When Order Item is. This setting affects both email sending and gift code account creation. Choose ‘Invoiced’ to trigger them only after the invoice is created. Choose ‘Created’ to trigger both actions immediately after order creation:
It is also possible to deactivate the gift card code account if the order is cancelled, preventing its further use by setting Deactivate Gift Code Account if Order is Cancelled to Yes.