Yes, you can leave the US while a US Re-entry Permit application is pending. In fact, you can even have the Re-entry Permit sent to a US consulate abroad for you to pick up when it is approved. However, you must be in the US when the Re-entry Permit application is filed, and you must also be in the US to do the biometrics appointment. At other times, you do not have to be in the US.