In many of today's Bible versions the OT books (as well as NT books) are categorized into certain groups. The books of the OT are often grouped in the following categories:
Books of Law Genesis - Deuteronomy
Books of history Johuasua - Esther
Poetic Books Job - Song of Solomon
Prophetic Books Isaiah - Malechi
This categorization goes most likely back to how the books were grouped in the Septuagint translation of the OT. Overall, according to this grouping, the OT is comprised of 39 books.
The Hebrew Bible has a different categorization:
Thora (The Law)
The Law comprises the first five books of Moses, Genesis - Deuteronomy.
The prophets are divided into the "former (earlier)" and "latter (later)" Prophets. The former prophets are Joshua, Judges, Samuel and Kings; the later Prophets are Isaiah, jeremiah, Ezekiel and the Book of the "12 prophets" Book (the so-called "minor prophets").
The Writings are then the rest of the Books, that is Psalms, Job, Proverbs, Ruth, Song, Ecclesiastes, Esther, Daniel, Ezra/Nehemiah, Chronicles.
This grouping of the OT is mentioned in various ways in the Bible, for example with mentioned to "the Law", "Law and the Prophets", or "Law, Prophets and Psalms [Writings]". A rather remarkable scripture is in Lk 24:44: "And he said unto them, These [are] the words which I spake unto you, while I was yet with you, that all things must be fulfilled, which were written in the law of Moses, and [in] the prophets, and [in] the psalms, concerning me."