To prevent mesial drift of a permanent first molar, the ideal time to place a distal extension space maintainer is

immediately after extraction of the primary second molar

as soon as the tooth erupts through the gingival tissue.

after the permanent second molar has erupted.

as soon as the extraction site of the primary second molar has completely healed.