Do you plan to travel after graduation / Optional Practical Training or file an application for Change Of Status (COS)? Your return to the U.S. could be delayed, and travel out of the U.S with a pending COS application amounts to the abandonment of the application. Ask yourself if you could wait outside to process your H-1B or another visa.
USCIS' policy is to allow travel before taking up employment as H-1B. However, because of SEVIS, border inspection issues, and uncertainty about the gap in time between the end of F-1 and the start of H-1B status, travel out of the United States is risky before approval of your H-1B or other Change of Status.
It would be different if the foreign national holding a valid visa to re-enter for the purposes consistent with that visa. E.g., an F-1 holder seeks to re-enter the United States on his preexisting F-1 visa and continues the education program, and F1 could change status later on to H1B.
A valid visa is always required before entering U.S. Consular posts, and CBP officers at the Port of Entry would be more closely scrutinizing requirements. Learn how to avoid the risks before you travel.
Returning to join work for optional practical training (OPT) after traveling abroad upon completion of the academic course or program or before the H-1B start date could be problematic. You could have a problem reentering even with an approved change of status notice until the effective date of H-1B.