There are many apps which allow you to create or 'design' ringtones (plus other alerts: text message and email tones for example) on your iPhone. However, none have access to the necessary folders on the iPhone so can't save those tones directly and have them appear in the tones list.
Make a song on your iPhone into a ringtone
Instead, you have to save those .m4r files to your computer and sync with iTunes to get those tones working on your iPhone.
The one exception to this rule is Garageband, which can create and save ringtones on an iPhone without needing a separate computer at all.
Here's a tutorial on how to use Garageband to make a ringtone on an iDevice running iOS 6.
It's easy enough, however, to use iTunes to make your ringtone, then sync your iPhone to import the tones.
Here's how to do it. (We're using iTunes 11.0 here, but it's a very similar process in older versions.)
1: On your PC, load iTunes by opening the Start menu and selecting the program from the list.
2: From your library, right-click on the song you want to use as a ringtone and then select Get info.
3: Select the Options tab and then tick the Start Time and Stop Time boxes. Enter times at which you want the ringtone to start and stop. You will have to listen to the track first and note down the time you want it to start. The stop time must be within 30 seconds, as this is the maximum length for a ringtone.
4: Click OK. Right-click on the track again, and then select Create AAC version. iTunes will convert the song. It will appear as a duplicate track - you can identify it by the track length in seconds.
5: Right-click on the original track, and then using the Options tab from the Get info menu, return the start and stop times to their original times. Otherwise, when you play that track, it will only play the section between your start and stop times!
6: Right-click on the short ringtone track and click Show in Windows Explorer.
The file will be highlighted. Right-click on it and choose Rename. Now change the extension from .m4a to .m4r. Click Yes when asked if you want to change the extension. If you can't see the extension, it's because Windows is set to hide the extensions. To show the extension for editing, follow the instructions here
7: Double-click the file to add it to your iTunes library (or add it using the 'Add file to library' menu option in iTunes). Then, in iTunes, click the drop-down arrow to select the Tones section of your library. You'll see your ringtone there.
8: Connect your smartphone to your PC and click on iPhone when it appears on the right-hand side of iTunes.Make sure Tones is set to sync with your phone. If you choose 'selected tones' rather than 'All tones' make sure you tick the tones you want to appear on your iPhone.
9: When the sync is finished, tap Settings on your iPhone, then Sounds, then Ringtone and select the new tone. It should appear at the top of the list, above the default Ringtones.