Launching to Mars is all about timing. Earth takes 365 days to orbit the sun and Mars takes 687 Earth days. Every 26 months, Earth catches up to Mars' elliptical orbit and the two planets have their closest rendezvous, providing an optimal launch window.
Musk plans to take advantage of the next window in 2018 by sending an unmanned Dragon 2 spacecraft on a test flight to the Red Planet, where it could yield valuable information about landing large payloads on the surface. Dragon 2, which provides as much interior room as an SUV, won't be the same spacecraft humans would use to make the eight month journey to Mars.
NASA will offer SpaceX technical support for the 2018 launch, including access to the Deep Space Network, a telecommunications system allowing space probes to "phone home" to Earth, in exchange for data on Martian entry, descent and landing, according to a blog post from NASA Deputy Administrator Dava Newman. SpaceX will fund the mission.
The ability to slow down a spacecraft after it has been traveling at a high velocity is required for a long-haul mission -- and the data NASA receives from SpaceX could be crucial about informing a future mission to the Red Planet.