The Part 107 exam is not administered by the FAA but rather is contracted out to independent testing facilities. Unsurprisingly, it’s not clear what the test is actually called when you go to register.
What you’re looking for is Unmanned Aircraft General – Small for your first time and Unmanned General – Recurrent for those who are already certified and just need to renew their certification.
The registration fee is around $175, which goes to the testing facility. The FAA receives nothing.
How long you should schedule your exam in advance really depends on the size of the facility. Some are small, one-computer rooms while others have 20 stations. Some people have been able to get in the next day while others have to wait a week. Plan accordingly.