The moon rises in the eastern sky and sets in the western sky because of Earth's rotation. Its rising and setting positions vary throughout the year from northeast/northwest to due east/west to southeast/southwest.
Earth rotates counter-clockwise on its axis. Because of this motion, celestial bodies such as the sun, moon and stars appear to rise in the eastern sky and set in the western sky. In addition, Earth is tilted on its axis by 23.5 degrees. Because of this, the sun's rise and set positions vary by up to 23.5 degrees north or south of due east or west throughout the course of a year. The moon's pattern is close to that of the sun's. It orbits Earth on a plane that is only about 5.1 degrees off the path of the sun. This causes the position of the moonrise and set to vary up to 28.6 degrees north or south.
The moon orbits completely around Earth in 28.5 days. This causes the moon to move through its range of variation much quicker than the sun appears to, creating a noticeable position change against the horizon each night. The moon doesn't rise at the same time each night. Due to the speed of Earth's rotation and the moon's orbit, the moon rises about 50 minutes later each day. Interestingly, all these changes in relative position to the sun make the moon appear to go through its waxing and waning phases.