The ability of the solar wind to blow away a planet's atmosphere has very little to do with gravity. On Earth, the magnetic fields generated by the planet's iron core creates the magenetosphere. Most of the solar wind consists of ions, which are charged particles; the Earth's magnetic field deflects these, so that the bulk of the solar wind is deflected and flows around our atmosphere without disturbing it much.
On Venus, the outermost layer of the atmosphere is a very thick, electrically charged ionosphere. It acts similarly to a magnetic field, causing the solar wind to deflect and not remove Venus' atmosphere.
The probes we have sent to Mars indicate that, while that planet apparently had some magnetic field around it in the past, it does not have one now. Consequently there is nothing the deflect the solar wind; many scientists now believe that Mars had an atmosphere, but lost it when the magentic field failed.
There is an excellent Nova video called "Magnetic Storm" about this; if you are interested in learning more about planetary magnetic fields, you can watch it here.