Hi,
The order is only created at the end of the checkout.
If you use a payment gateway where the customer is redirected to the gateway after the checkout, the order has to be created before the user enters his credit card information.
If you use a payment gateway where the customer enter his credit card information before finishing the checkout (like with PayPal Pro, Authorize.net in AIM, CardSave in hosted mode, etc), the order will only be created if the payment is validated by the payment gateway.