Traveling outside of the U.S. while a change of status is pending is not advised. If you do, your change of status application with USCIS will be considered abandoned. You will then either have to start over with a new change of status application or apply for an F-1 visa from a U.S. embassy/consulate.

You may travel after your change of status to F-1 is approved; however, you will need to go through the F-1 visa interview to obtain an F-1 visa in your passport and re-enter the U.S. on F-1 status. Please note that traveling at any time does involve risk as an F-1 visa from a consulate/embassy is not guaranteed.