In the Book of Exodus the Lord meets with Moses on top of a mountain and gives him these commands.

Bonus Questions
What happened to the first set of stone tablets? (Exodus 34:1)
Which commandment did Jesus say was the greatest? (Matthew 22:35-40, Mark 12:28-34, Luke 10:27)

Main Thought
We know what God commands us to do, but not everyone agrees on the order these are numbered. Jesus and the Pope would probably number them differently. What’s important is God never says here are the 10 things I command.

Wikipedia – Ten Commandments § Numbering schemes