How restrict Anonymous users from creating accounts
Go to sitename.com/admin/config/people/accounts

Scroll down to find REGISTRATION AND CANCELLATION

Select appropriate option in Who can register accounts? field