That is a good question. Short answer: We don't know.
The answer is not in the record as we have it.
We have on a third of the record translated. The other two-thirds were not allowed to be translated by God and could include a record of Moroni's travels trying to preserve the record before he buried them. His father Mormon hide the records in a hill called Cumorah before the Lamanites destroyed the last official army of the Nephites, destroying the nation as a political entity. Mormon told Moroni where the records were before he died.
It had to have been a considerable amount of time since he was allowed to write two additional books on the plates before having to deposit them. Each chapter he concluded seemed like he said farewell. He never knew when his time would end. It could have been months or years.
Moroni took the records and finished them and deposited them in what became New York. Assumptions have been made by the early Saints that Moroni placed the records back in the hill Cumorah, but there is no way for us to know that since Mormon placed ALL the sacred records in the hill, but only the Plates of God were shown to Joseph by Moroni. Others have returned to the hill seeking other treasures.