Having trouble with the sleep button on your iPhone 5? Apple might fix it for free:
Apple has determined that the sleep/wake button mechanism on a small percentage of iPhone 5 models may stop working or work intermittently. iPhone 5 models manufactured through March 2013 may be affected by this issue.
Apple will replace the sleep/wake button mechanism, free of charge, on iPhone 5 models that exhibit this issue and have a qualifying serial number.