The Ten Commandments were written by GOD upon two tablets of stone and then given to Moses on mount Sinai. Most scholars date this event around the 13th or 14th century BC. GOD gave the Decalogue, or 10 Commandments, to the Israelites shortly after they left Egypt. The record of the Ten Commandments can be found in the Bible, both in Exodus 20:2-17 and Deuteronomy 5:6-21.
Through the history of Christianity, few portions of the Old Testament have influenced the church more than the Ten Words revealed by GOD to Israel at Mount Sinai. While often termed the “Ten Commandments,” the Hebrew label preserved in Exod 34:28, Deut 4:13, and 10:4 is “Ten Words,” which is also the etymology of the term Decalogue (from the Greek deka ‘ten’ + logoi ‘words’). Nevertheless, Moses declares that the Ten Words were “commanded” (Deut 4:13), and Jesus explicitly calls them “commandments” (Matt 19:17-19), so the traditional title is not misdirected.
Exodus Chapter 20 -
1 And God spake all these words, saying,
2 I am the LORD thy God, which have brought thee out of the land of Egypt, out of the house of bondage.
3 Thou shalt have no other gods before me.
4 Thou shalt not make unto thee any graven image, or any likeness of any thing that is in heaven above, or that is in the earth beneath, or that is in the water under the earth:
5 Thou shalt not bow down thyself to them, nor serve them: for I the LORD thy God am a jealous God, visiting the iniquity of the fathers upon the children unto the third and fourth generation of them that hate me;
6 And shewing mercy unto thousands of them that love me, and keep my commandments.
7 Thou shalt not take the name of the LORD thy God in vain; for the LORD will not hold him guiltless that taketh his name in vain.
8 Remember the sabbath day, to keep it holy.
9 Six days shalt thou labour, and do all thy work:
10 But the seventh day is the sabbath of the LORD thy God: in it thou shalt not do any work, thou, nor thy son, nor thy daughter, thy manservant, nor thy maidservant, nor thy cattle, nor thy stranger that is within thy gates:
11 For in six days the LORD made heaven and earth, the sea, and all that in them is, and rested the seventh day: wherefore the LORD blessed the sabbath day, and hallowed it.
12 Honour thy father and thy mother: that thy days may be long upon the land which the LORD thy God giveth thee.
13 Thou shalt not kill.
14 Thou shalt not commit adultery.
15 Thou shalt not steal.
16 Thou shalt not bear false witness against thy neighbour.
17 Thou shalt not covet thy neighbour's house, thou shalt not covet thy neighbour's wife, nor his manservant, nor his maidservant, nor his ox, nor his ass, nor any thing that is thy neighbour's.
Dealing with Differences in Deuteronomy 5
As for the relationship between Exodus 20 and Deuteronomy 5, there are clear differences in Deuteronomy’s version of the Decalogue. Most obvious are (1) the change of focus from God’s work in creating the world to his work in creating a people (i.e., the Exodus) as the basis for Sabbath keeping (Deut 5:12-15), (2) the shaping of the final six prohibitions into a single unit by a fronted “and” (5:17-21), and (3) the transformation of the prohibitions against coveting (5:21a-b) by using two different verbs, by including “field” before the list of household members, and by transposing “house” and “wife,” thus separating the latter from the list and placing the charge against lust (i.e., coveting a neighbor’s wife) on its own line.
Nevertheless, it is evident that, even with these alterations, Deuteronomy itself treats its Decalogue as a reiteration of the very “Ten Words” spoken by God out of the midst of the fire at the mountain of God—namely, as an echo of Exod 20:1-17 (cf. Deut 5:4-5, 22 with 4:12-13 and 10:4). After the 40 years in the wilderness (1:3-4; 4:45-46), the Ten Words have been updated, probably for pastoral purposes. But Moses still stresses that, while the Deuteronomic version is a secondary account, it is nevertheless “just as Yahweh your God commanded you” (Deut 5:12, 16).
The book Deuteronomy, Chapter 5 -
6 I am the LORD thy God, which brought thee out of the land of Egypt, from the house of bondage.
7 Thou shalt have none other gods before me.
8 Thou shalt not make thee any graven image, or any likeness of any thing that is in heaven above, or that is in the earth beneath, or that is in the waters beneath the earth:
9 Thou shalt not bow down thyself unto them, nor serve them: for I the LORD thy God am a jealous God, visiting the iniquity of the fathers upon the children unto the third and fourth generation of them that hate me,
10 And shewing mercy unto thousands of them that love me and keep my commandments.
11 Thou shalt not take the name of the LORD thy God in vain: for the LORD will not hold him guiltless that taketh his name in vain.
12 Keep the sabbath day to sanctify it, as the LORD thy God hath commanded thee.
13 Six days thou shalt labour, and do all thy work:
14 But the seventh day is the sabbath of the LORD thy God: in it thou shalt not do any work, thou, nor thy son, nor thy daughter, nor thy manservant, nor thy maidservant, nor thine ox, nor thine ass, nor any of thy cattle, nor thy stranger that is within thy gates; that thy manservant and thy maidservant may rest as well as thou.
15 And remember that thou wast a servant in the land of Egypt, and that the LORD thy God brought thee out thence through a mighty hand and by a stretched out arm: therefore the LORD thy God commanded thee to keep the sabbath day.
16 Honour thy father and thy mother, as the LORD thy God hath commanded thee; that thy days may be prolonged, and that it may go well with thee, in the land which the LORD thy God giveth thee.
17 Thou shalt not kill.
18 Neither shalt thou commit adultery.
19 Neither shalt thou steal.
20 Neither shalt thou bear false witness against thy neighbour.
21 Neither shalt thou desire thy neighbour's wife, neither shalt thou covet thy neighbour's house, his field, or his manservant, or his maidservant, his ox, or his ass, or any thing that is thy neighbour's.  For a helpful, balanced, and scripturally faithful assessment of the role of the Decalogue in ancient Israel as witnessed to in the Old Testament, see Daniel I. Block, “Reading the Decalogue Right to Left: The Ten Principles of Covenant Relationship in the Hebrew Bible,” in idem, How I Love Your Torah, O LORD! Studies in the Book of Deuteronomy (Eugene, OR: Cascade, 2011) https://www.thegospelcoalition.org/article/you-asked-which-is-the-real-ten-commandments/