Strict password policies are one of the best ways to keep unwanted users from your organization.
In Setup:
1. Go to Security > Password Policies
Here you can find settings and restrictions for passwords and login logout periods. Find more details here.