Hi Stephanie
Your iPhone - including the Sleep/Wake button - is covered as standard by Apple's Limited Warranty (for one year, in the US, for example) against defects in materials and workmanship (but not against accidental damage or misuse).
It may help to follow the steps here, including checking for any debris or dirt around the button and cleaning it with a soft cloth:
Get help with buttons and switches on your iPhone, iPad, or iPod touch - Apple Support
If the issue persists, contact Apple Support, make a Genius Bar reservation or visit an Apple Authorised Service Provider to arrange for your iPhone to be inspected and, if service is recommended, to establish your available service options: