The iPhone doesn't have a block feature built into the operating system, as of iOS 6 in June 2013. While you can temporarily stop calls and text messages from coming in via the Do Not Disturb feature, the only way to truly block calls and texts from a number is to add an app. The catch? Most of these apps only work on jailbroken iPhones. However, with basic workarounds you can ignore callers without jailbreaking your iPhone.
Call Bliss, available for free from Apple's app store, allows you to block and blacklist callers in a number of situations. It's a third-party app designed as an improvement on Apple's "Do Not Disturb" feature. It does not block text messages. Otherwise, the only other apps for blacklisting and blocking callers are available for jailbroken phones.
Video of the Day
Cydia, the app store only available on jailbroken iPhones, has several apps for blocking individual numbers. iBlacklist offers the most features, including call blocking, SMS blocking and even a whitelist. Another app available from the Cydia app store is Call Blocker, which allows you to create a blacklist of blocked callers. You can even turn blocking on and off at will for each number you've added to the blacklist.
Worth Jailbreaking Your iPhone?
You're within your rights when you jailbreak your iPhone; despite what some believe, it is legal. However, jailbreaking your iPhone does void the warranty. If something goes wrong, you will not be able to turn to Apple for support -- and there's always the slim risk that you could damage your phone beyond use. If you do choose to jailbreak your phone, make sure you've read all the documentation and understand what you're doing before you get started.
If jailbreaking isn't right for you, then the best option is to use iOS' features to your advantage. One option is to set the Do Not Disturb feature as on all the time, with only specific callers (such as your favorites) able to ring through. Another option is to create a contact called "Blocked" or something similar, and set it up so that it has a silent ringtone and does not notify for texts. With this method, you can add multiple numbers to the same contact and effectively ignore them.