Download this extension from CiviCRM.org
The CiviDiscount extension allows you to create discount codes which users can redeem when paying a contribution or event fee.
Enable the CiviDiscount extension in Administer > Customize Data and Screens > Manage Extensions.
Then you access the extension at your/civicrm/baseurl/cividiscount/discount/list?reset=1
For easier access, you can add a link to that URL in your CiviCRM menu by adding a link to your/civicrm/baseurl/admin/menu?reset=1 at Administer/Customize Data and Screens/Manage Extensions.
To apply a discount code to an event by URL use this format: civicrm/event/register?reset=1&id=XXX&discountcode=YYYY
Documentation and ReadMe found at https://github.com/dlobo/org.civicrm.module.cividiscount