For direct payment gateways, the discount code can be entered on page 2 of the checkout process when the customer has the opportunity to select a shipping method and enter in credit card information.
PayPal Express, being an offsite payment gateway, works a bit differently. This is the Paypal Express Checkout's workflow: when checking out your customer goes to paypal.com right away, where Paypal collects his shipping and billing addresses. After that, the customer returns to Shopify where he picks a shipping rate, types in a discount code (if you have discount codes that are 'active'), the price is updated accordingly and, on that same page, your customer gets to finalize his transaction.
Learn more about discount codes here.