You can unenroll from an edX course at any time. There are absolutely no academic penalties associated with incomplete edX studies. You can enroll again for the same course (if it is still offered) at a later time.
Note: If you registered and paid for a verified certificate, refunds are only available within 14 days of your payment, or within 14 days after the course begins (whichever comes later). Please note that Professional Education courses offer refunds within 2 days of payment, or up to 2 days after the course start date.