If your school has a school email domain, you'll notice that classes on Piazza require students to have a school email address in order to sign up. If you'd prefer that students enter a course password (or "access code") so that they can enroll with any email address, visit Manage Class > General Settings and click Add access code.

Enabling an access code after students have already enrolled will not affect the experience of the students who have already joined the class. Instructors can change the access code at any time.