Discount codes are setup in the Settings - Discount codes page. Codes are grouped into sets and each set is assigned to particular entries, tickets, or tags. This restricts what tickets or booking types the codes can be used for.
Codes themselves can be set to be either fixed or percentage off, and can be limited in the number of times they are used and can have an expiry date set. The usage limit (the 'How many times can the code be used?' setting) sets the limit on the code as a whole across all bookings, not just for a single booking or person. The purpose of this is mainly to allow you to set single use voucher codes that can only be used once by anyone.
The entries, tickets, or tags that a codes set is assigned to allows you to restrict the use of the codes in the set to a particular event type (entry), or a specific ticket, or entries that have been given a particular tag.
To use a discount code, the booker must enter the code on the 'selected items' page before starting the booking by clicking the 'Enter discount code' option.