First, the version we have was written in 1843 at the request of Hyrum. He (Hyrum) intended to take it to Emma and persuade her it was from God. Hyrum knew this revelation had been a continuing source of friction between Joseph and Emma and he offered to try and get Emma to accept its truthfulness. So Joseph agreed to dictate it. The scribe was summoned, and Hyrum asked if he should retrieve the Urum and Thummim. Joseph responded that he could recite it from memory, and then dictated it as it now appears in Section 132.
There were two copies made. The one Hyrum took to Emma was burned by Emma. The second came west and was ultimately made public in the 1850's and added to the scriptures.
The dating of the revelation is uncertain, but the headnote to Section 132 notes that "the principles involved in this revelation had been known by the Prophet since 1831." (Section 132, headnote.) Given the uncertainty of dating, the typical approach by scholars has been to date it from when the first practice began. I think that is wrong. I would date it from the time Joseph translated Jacob, Chapter 2, in 1829. Joseph prayed during the translation of the Book of Mormon to receive the visitation of John the Baptist and the ordinance of baptism. I see no reason why the translation of Jacob 's comments on plural wives would not have provoked a similar inquiry and revelation.
We know the information was suppressed from at least 1831 to 1843. What we do not have is an earlier version from which to reconstruct the entire process; we only have the finished product in 1843. With that, I think the revelation divides into sections as follows: