After the books added by Ezra only Nehemiah and Malachi remained. The canon of the Hebrew Scriptures was, therefore, well fixed by the end of the 5th century B.C.E. They were considered either as 22 or 24 books depending if Ruth was included with Judges and Lamentations was included with Jeremiah or not. What we have today as canon therefore has been completed since about 443 B.C.E.
Was it generally recognized as such at the time of the writing of the Christian Greek Scriptures?
The Jewish historian Josephus, in answering opponents in his work
Against Apion (I, 38-40 [8]) around the year 100 C.E., confirms that by then the canon of the Hebrew Scriptures had been fixed for a long time. He wrote: “We do not possess myriads of inconsistent books, conflicting with each other. Our books, those which are justly accredited, are but two and twenty, and contain the record of all time. Of these, five are the books of Moses, comprising the laws and the traditional history from the birth of man down to the death of the lawgiver. . . . From the death of Moses until Artaxerxes, who succeeded Xerxes as king of Persia, the prophets subsequent to Moses wrote the history of the events of their own times in thirteen books. The remaining four books contain hymns to God and precepts for the conduct of human life.” -
Canon — Watchtower ONLINE LIBRARY