MaryEllen Elia, who is the first female commissioner in the history of the New York State Education Department, said now is the right time to leave the post, and has agreed to accept a job with a national firm that works to turn around struggling public schools.