WASHINGTON—Republicans united in their desire to overturn the Affordable Care Act are divided over whether to replace it before or after the 2018 elections, a choice that holds political peril either way.

Waiting until after the midterms could pose a political risk to the most conservative Republicans who campaigned on the repeal and whose constituents want the law to be gone as quickly as possible.