Contrary to the ‘point and shoot’ idea, an actual trip to Mars looks very round-a-bout as the figure above shows for a typical ‘minimum cost’ trajectory. This, by the way, is called a Hohman Transfer Orbit, and is the mainstay of interplanetary space travel. All you need to do is give your payload a few km/sec of added speed at Earth to place you into the right elliptical orbit whose aphelion is at the location of mars, and then when you get there you fire your rockets in the opposite direction a second time to reduce your speed by a few km/sec to put you into a mars-capture orbit. You spend your entire flight coasting between the planets with no rockets firing. That’s what makes it a cheap flight in terms of fuel, but an expensive one in terms of flight time. In the end, it is always fuel cost that wins.
The travel time depends on the exact details of the orbit you take between the Earth and Mars. The typical time during Mars’s closest approach to the Earth every 1.6 years is about 260 days. Again, the details depend on the rocket velocity and the closeness of the planets, but 260 days is the number most often estimated, give or take 10 days. Some high-speed transfer orbits could make the trip in as little as 130 days.
That said, chemical rockets are very inefficient for interplanetary travel with specific impulses of about 250 seconds and maximum speeds of 10 km/sec. For some really quick trips ,engineers consider advanced ion propulsion systems with specific impulses of over 5000 seconds and maximum speeds of 100 km/sec and travel times of a month. Nuclear-thermal rockets can do even better with speeds up to 10,000 km/sec. At these speeds, a trip to Mars becomes less than a week!