Mercury and Earth both orbit the sun, so the distance between the two planets is constantly changing.
The minimum distance between the planets is approximately 0.6AU. (AU is astronomical units, where 1a.u. is the mean distance from the earth to the sun. This is approximately 93 million miles.) The maximum distance between the planets is slightly more than 1.4 AU. The mean distance is 1.04 AU.
Assuming the distance to be the mean distance, it would take light about 9 minutes to travel to Mercury from the Earth.
If you just wanted to do a "fly-by' of Mercury, the average speed of deep-space probes is approximately 30,100 miles per hour, so the trip would take approximately 3213 hours or 134 days. However, there are many complications. Mercury completes an orbit every 88 days, so you would have to time the launch to minimize the distance.
Another problem you would encounter is that you would zip by the planet at 30,100 miles per hour. If you wanted to visit the planet, you would need to decelerate. This either takes a huge amount of fuel or you can use orbital mechanics to slow down. The Messenger probe visited Earth and Venus a couple of times and passed by Mercury three times before achieving a slow enough speed to orbit the planet. The maneuvers took about 7 years.
So if you are asking for the time for light to travel to Mercury it is about 9 minutes; a one-way probe (crashing into the planet or doing one "fly-by" could be accomplished in about 4.5 months; and a trip that ends in an orbit of the planet either needs an inordinate amount of fuel to brake, or must use long-term maneuvers taking as long as 7 years.
All planets orbit the sun. Mercury is very close to sun. Because of this its orbit takes 88 days while earths orbit takes 365 days. The distance between earth and mercury changes from time to time. Currently the distance is 113 million km or 70 million miles (recorded in October 2014).
Approximately it would take 40 days to travel from mercury to earth when they are close enough. Days can increase when distance increases.