Two-factor authentication is an extra layer of security for your Apple ID that is a requirement for enrolling in to the Apple Developer program.
Please review the below article on setting this up.
What if you don't have an Apple device to set up 2 factor authentication? See this article.