You may. We recommend that you seek the advice of your immigration attorney regarding this matter.
Once you are married to a U.S. citizen, you may have difficulties returning to the United States because the U.S. Customs and Border Patrol (USCBP) may think you have the intent to immigrate to the United States to be with your U.S. citizen spouse. This is not permitted for individuals in F-1 or J-1 status.
Also, if you chose to file paperwork to become a permanent resident while in the United States (Adjustment of Status), you cannot travel on your F or J visa. Doing so would cause your I-485 Application to Adjust Status to Permanent Resident to be abandoned and denied. Instead, you will need to file an I-131 Application for Advance Parole and wait for it to be approved. You can travel freely during the validity period of your Advance Parole document.
If you have any problems with your F or J status, you should speak with an immigration attorney before filing any applications or before traveling abroad.