The short answer
Numbers was probably written during Israel's wilderness journey, with Moses traditionally understood as its main human author. A careful answer needs a little humility, though. Scripture tells us when the events took place, but it does not give a modern-style publication date for the finished book.
The book opens when Israel has been out of Egypt for a little over a year. It closes with the people camped in Moab, across the Jordan from Canaan, preparing for the next stage of their story (Numbers 1:1; Numbers 36:13).
And the Lord spake unto Moses in the wilderness of Sinai, in the tabernacle of the congregation, on the first day of the second month, in the second year after they were come out of the land of Egypt, saying,
Its story spans nearly forty years
The name Numbers comes from the censuses recorded early in the book. Yet it contains far more than lists of people. It follows Israel through rebellion, grief, battles, renewed instruction, and God's steady provision in the desert.
Aaron died in the fortieth year after Israel left Egypt (Numbers 33:38). Since Numbers begins in the second year and reaches that point near its close, it covers roughly thirty-eight to thirty-nine years of the wilderness period. That makes a date near the end of the journey a sensible traditional setting for its completion.
Why Moses is traditionally connected with it
Numbers specifically says that Moses wrote down the stages of Israel's journeys at the Lord's command (Numbers 33:2). The final verses also identify Moses as the one through whom the Lord gave these commands on the plains of Moab (Numbers 36:13).
Elsewhere, Deuteronomy says Moses wrote the law and gave it to Israel's priests (Deuteronomy 31:9). For that reason, the first five books of the Bible have long been linked with Moses. This does not mean the text tells us the precise day he completed every section. It does give good reason to see the book as rooted in Moses' leadership and witness.
And Moses wrote their goings out according to their journeys by the commandment of the Lord: and these are their journeys according to their goings out.
What about dates like 1406 BC?
You may see Numbers dated around 1406 BC. That is a traditional estimate, not a date printed in the book itself. It follows a chronology that places the exodus about forty years earlier and connects Israel's history with the timeline given later for Solomon's temple (1 Kings 6:1).
Faithful readers do not all calculate the wider chronology in exactly the same way. Still, the central point is clear from Numbers itself: these words come from Israel's wilderness generation and lead right up to the threshold of the promised land. Reading Numbers alongside Exodus, Deuteronomy, and Joshua helps its place in the story come alive.
