Which book of the law is Joshua 1:8 referring to? Since Joshua 1:8 says 


  Do not let this Book  of the Law depart from your mouth; meditate on it day and night,


So which Book of the Law is Joshua 1:8 referring to, since we have 66 books in the Bible and three laws, namely The Law of Moses, Psalms, and the prophets
The traditional historic view of Joshua’s reference to the “book of the Law” is it refers to the Pentateuch that was written by Moses.  That is the first five books of our current Bible known as Genesis, Exodus, Leviticus, Numbers, and Deuteronomy.  The Pentateuch is also known as the Torah.

In fact, the word “Torah” is in the text at, among other places, Joshua 1:8.

תּוֹרָה
towrah

The KJV translates Strong's H8451 in the following manner: law (219x).
-source-

There are some scholars most recently who believe that the Torah had four unique authors and was composed over hundreds of years.  Even if one takes this view, however, it would not diminish the understanding to what Joshua was referring.  For example, Joshua refers not just to the “book of the Law”, but also the “book of the Law of Moses” and the “book of the Law of God”.  That would still be the Pentateuch.  


  As Moses the servant of the LORD commanded the children of Israel, as it is written in the book of the law of Moses,
  Joshua 8:31


Deuteronomy self describes the book of the law this way.


  Take this book of the law, and put it in the side of the ark of the covenant of the LORD your God, that it may be there for a witness against thee.
  Deuteronomy 31:26


Throughout the Israelite history in Chronicles and Kings there are numerous references to the book of the law of Moses.  It was understood that Moses wrote the Pentateuch.

After the Dispersion when the Israelites regathered in the land under Nehemiah, the book of the law was still known as the first five books.


  and they spake unto Ezra the scribe to bring the book of the law of Moses, which the LORD had commanded to Israel.
  Nehemiah 8:1b


By the time of Christ, the division of the Hebrew Bible was identified as three sections, Law or Teachings, Prophets, Psalms or Writings.  This is known as the Tanakh. 


  And he [Jesus Christ] 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.
  Luke 24:44


Some 2000 years ago it was common knowledge that the “book of the law” referred to the first five books of the Hebrew Bible.


  For as many as are of the works of the law are under the curse: for it is written, Cursed is every one that continueth not in all things which are written in the book of the law to do them.
  Gal. 3:10


The point in showing the understanding centuries after Moses and Joshua is that the traditional historic view confirms to what the book of the law Joshua would be referring.  It was the first five books of what is the Hebrew Bible.