When student accounts are created in bulk with no email addresses attached, they will default to being child accounts, and the teacher will receive an email with all of the usernames and passwords. If you can locate this email (searching for some of the earliest emails involving a student username is usually helpful), you can find the usernames and passwords for the class.
If this is lost, there's no way to recover lost passwords unless the child has previously connected a parent account (in which case the parent controls the account settings).
You can create new accounts for the students and create your own passwords using the instructions here.
Here are some tips when getting started:
When creating accounts for students, add their parent email address (double checking to make sure it's correct -- a lot of times these are entered incorrectly) so parents will receive an email from Khan Academy inviting them to create an account as well.
Note: The email attached to the account which creates the student accounts will be shared with parents. Write down or print the usernames and passwords for the student accounts. You can pass these along to the next teacher, although you should keep in mind that a parent can change the password at any time. Teachers do not have the ability to look up or change student passwords.