This file will be in M4A format.
If you don't typically connect your phone to your PC, well, you'll need to for this.
You can directly save MP3 on iPhone from YouTube automatically and wirelessly! You can make it shorter and the audio will loop.
Open the iTunes app on your phone, tap More bottom right corner and then tap Tones.
The maximum length for the ringtone is 30 seconds.
Then click the M4R button and, finally, Make Ringtone.