Most probably after the 3rd War. It seemed like Orochimaru was already a rogue ninja when he took in Kimimaro. Also, Kimimaro is supposed to have died in his teens. So that would place the extinction of the Kaguya clan after the 3rd War. Note also the fact that Haku was already around 9-10 years old when Zabuza+Haku (who were fleeing Kirigakure) bumped into Orochimaru and Kimimaro. And Haku also died in his teens while defending Zabuza. So that means that the event in question took place after the 3rd War.
Thank :) That was a great help ~
It had to be after the 3rd war, though the part where Haku meets them I believe is anime-only, and not manga-canon.
But still the fact that after the 3rd war is very broad, as there is roughly a 13 year long period between the end of the 3rd war and the start of the series.
Though I believe it happened after the Kyubi incident and after Orochimaru left.
It had to have happened when Kimimaro was very young. Orochimaru took in Kimimaro, Kimimaro took in Jūgo, then Orochimaru developed the cursed seal and gave one to Anko. So unless Anko left Konoha with him like she did in that old filler arc, there is a very tight time span for all of this to happen.