Here's how to turn on two-factor authentication in Settings (If you're using iOS 10.3 or later):
- Go to Settings > [your name] > Password & Security.
- Tap Turn On Two-Factor Authentication.
- Tap Continue.
If you're using iOS 10.2 or earlier:
- Go to Settings > iCloud.
- Tap your Apple ID > Password & Security.
- Tap Turn On Two-Factor Authentication.
- Tap Continue.
You might be asked to answer your Apple ID security questions.
You may check the link provided below for more information:
Two-factor authentication for Apple ID
Hope it helps!