How long does it take for methotrexate to clear out the body after use for ecotopic pregnancy? Will it cause infertility?

Unlikely. Low dose methotrexate as commonly used for problems like you have is cleared from the body in 48-72 hours. Infertility is a remote possibility as it can occur with any chemotherapy but Methotrexate is safer in this regard compared to alkylating agents.