you may leave as soon as you
submit the citizenship application, but you must come back for two critical events: citizenship test and citizenship ceremony, assuming you past the test at one try and will not be audited by immigration court. Otherwise you must go back to retake the test, or testify before the judge.