Tanakh is a Hebrew acronym formed from the names of its three divisions. Torah is the five books of Moses. Neviim, the Prophets, splits into the Former Prophets, Joshua, Judges, Samuel and Kings, which read as narrative history, and the Latter Prophets, Isaiah, Jeremiah, Ezekiel and the Twelve Minor Prophets counted as one book. Ketuvim, the Writings, is the most miscellaneous: Psalms, Proverbs, Job, the five scrolls read at festivals (Song of Songs, Ruth, Lamentations, Ecclesiastes, Esther), Daniel, Ezra-Nehemiah and Chronicles.
The Jewish count is 24 books. Protestant Old Testaments contain exactly the same text but reach 39 by splitting Samuel, Kings, Chronicles and Ezra-Nehemiah into pairs and counting the Twelve as twelve. The difference is arithmetic, not content. Catholic and Orthodox Old Testaments add further books not in the Hebrew collection at all.
The ordering difference is not arithmetic. The Tanakh ends with Chronicles, whose final verses are Cyrus's permission for the exiles to go up to Jerusalem and rebuild, the collection closes on return and restoration. Christian Old Testaments, following the arrangement of the Greek and Latin Bibles, regroup the material into law, history, poetry and prophecy, and end with Malachi and its promise of a messenger to come, which runs straight into the gospels. Both sequences are ancient; the choice between them is a theological one, and each tradition reads its own scripture through the shape it has given the whole.