On average, it takes between 150 to 300 days to travel to Mars. The time it takes to travel to Mars is dependent on the speed of the launch and the distance between Mars and Earth, due to both of their alignments.
There have been a number of successful missions to Mars since the 1960s. The first mission to Mars occurred on Nov. 28, 1964. It was then that the Mariner 4 launched and arrived 228 days later on July 14, 1965. This spacecraft took 21 photos and allowed NASA to see the surface of Mars up close. Since 1964, every other spacecraft that has traveled to Mars has taken between 150 and 300 days to reach the planet.