Check Your Mute Switch
First things first: check the Ring/Silent switch on the left side of your iPhone to make sure it's not turned on. The switch reveals a red bar while in the mute position, so flip the switch to the other position if it looks red.
Check Your Ringer Volume
Even if your phone isn't muted, if the ringer is set too low, you might not hear it above the sound of its vibration. By default, the volume buttons on the phone adjust the ringer volume any time you aren't listening to music, watching a video or playing a game, but a setting in iOS 7 and 8 can disable this feature. Try turning up the volume, and if the phone doesn't display a volume bar labeled "Ringer," check the Sounds page in the Settings app.
Turn on Change With Buttons to adjust the ringer volume with the volume buttons, or set the ringer volume with the Ringer and Alerts slider in the settings. Try turning the ringer volume up significantly and receiving a call to check whether your iPhone rings.
Work Around Switch Problems
A broken, dirty or stuck Ring/Silent switch can silence your phone even when it doesn't look like the switch is in the mute position, and adjusting the volume won't help. Take your phone out of its case, if you have one, turn the screen on, make sure the switch isn't dirty and try flipping the switch on and off. The phone should vibrate and display the word "Silent" when you mute it, and then display the ringer volume when you unmute it. If it doesn't, your switch might be broken. A repair or replacement through Apple is the best solution in the long term, but in the meantime, unmute your phone using this workaround:
Turn on AssistiveTouch, and you'll see a button appear near the top of the screen. This button opens AssistiveTouch features, and it appears on top of any app you have open. Tap the button.
Tap Device and then Unmute to unmute your phone. This setting overrides the the Ring/Silent switch, so it works even if the switch is stuck in the mute position. Tap anywhere else on the screen to hide the AssistiveTouch menu. When you need to mute your phone again, open AssistiveTouch to the Device page and tap Mute.