There are three physical volume controls on the side of the iPhone (or iPad or iPod Touch): the volume up & down buttons, as well as the mute on/off switch. What do you do if one or more of those buttons stop working? Fear not, you are not stuck at one volume (or mute!) for the duration of your phone's life, nor are you required to buy a new phone ahead of schedule (although we do suggest a stroll over to your nearest Apple Genius Bar to have the phone looked over, just in case the issue can be fixed under warranty!)
By turning on "Assistive Touch" in the Settings app (Settings App -> General -> Accessibility, scroll to the bottom of the menu,) you'll add a button to your iPhone screen that when tapped will present a menu of controls. Tap "Device" on the menu and from the Device controls you can tap on-screen buttons for volume up and down, mute, screen lock, and the home button.
If you do decide to use Assistive Touch in lieu of a broken iPhone button, I recommend enabling the "Accessibility Shortcut" (just below Assistive Touch) for Assistive Touch. Accessibility Shortcut will add the option to triple-click the home button to toggle on/off having the Assistive touch button on your screen -- then volume adjustment is a triple-click away, even if your volume buttons are broken.