You can leave the country after you have filed Form I-751, Petition to Remove Conditions on Residence. However, before that you will still need to wait for a receipt letter from USCIS called I-797, Notice of Action. This receipt letter will extend your residence for a period of time while your I-751 application will be processed, usually for 12 months.
When your conditional green card has already expired but your Form I-751 is still pending, it is obligatory to carry the following documents with you when travelling abroad: valid and unexpired passport, Notice of Action, expired conditional green card. When reentering the USA these documents will be a proof of your lasting conditional resident status.
Please note that if you have any problems with documents or if you have criminal offences history, it is advisable not to leave the United States untill the procedure is completed.
Also keep in mind that if your I-751 application is denied while you are abroad, you may not be able to reenter the USA. So if you plan to take a long trip, consider consulting an immigration attorney and obtaining a reentry permit.