A planet (as well as a dwarf planet) must, according to the IAU definition, have sufficient mass to assume hydrostatic equilibrium (a nearly round shape). Does it mean they would break apart or explode if gravity vanishes, unlike small bodies like comets or minor planets, whose integrity doesn't depend on gravity?
Even rocky planets would explode. I think there are two ways to see this.
From the perspective of forces, the earth is in equilibrium between the compressive force of gravity and the elastic resistance to compression of the materials that make it up. By Newton's third law, the mantle is pressing upwards on the crust with a force equal to the weight of the crust. If gravity disappears, you will still have that upward force with no downward force to balance it, so you will get upward acceleration.
You may think that the tensile strength of the crust will hold the planet together. But the upward force is the same as the weight of the crust. We know that very large stone structures cannot support their weight under tension.
You may also think that iron and rock aren't very compressible, so the mantle wouldn't expand very far. But the pressures are very great. The core has a density at least 25% greater than iron does under normal pressures. Plus, the temperature is around 6000K, equal to the surface of the sun and much higher than the boiling point of iron at atmospheric pressure. So the expansion won't just be a matter of some cracks forming.
From an energetic point of view, the potential energy of all the parts of the earth spread out across the protoplanetary disk was converted to heat and elastic potential energy when the earth formed. At least one study suggests that about half that heat remains, and in any case heat from radioactive decay has been added over time. If all the energy remained, it would be enough to disperse the earth with the same velocity that parts came together on average when it formed. Given that the energy is at least on the same scale, I think it's reasonable to expect an explosive breakup.
The hydrostatic equilibrium only dictates that the object holds a spherical shape, it does not determine whether the matter will in a solid form.
Gravity acts on planets, dwarf planets, comets, minor planets, and asteroids to keep them as a coherent form. Gravity acts on all matter in the universe. On smaller scales, human scale and smaller, other forces dominate over gravity, but larger than that, gravity begins to take over.
i guess if there were no gravity then the planets would not have been formed in the very first step because they are formed, as are stars and all other celestial objects, after the collision of particles which formed clusters, which then acquired sufficient gravity to pull more mass.
No, rocky planets would not explode. However, without gravity there would be no force to make the object round though. Atmospheres would escape to space though. Since air pressure is quite nice gradient from vacuum to normal air pressure, I would assume no major explosion would occur if gravity suddenly vanished.
Gas planets however would indeed explode rather violently. Their cores are degenerate, and thus particles do have a lot of kinetic energy. Without gravity this energy would need to go somewhere.
EDIT: gas giants would explode, rocky planets mostly not
While, as far as we know, this is impossible, it is interesting to consider what would happen. Most likely the planet would break apart and possibly, depending on several factors, explode. Rotation speed of the planet, strength of the planet, and presence of liquids or gasses on the planet would all come into play.
Here is how I would imagine it playing out on Earth. Without gravity binding the atmosphere to the Earth, it would fairly quickly expand out into the vacuum of space. The oceans would then boil away without atmospheric pressure holding them in place. Without the pressure compressing the magma inside the earth, it too would likely out gas and push the crust of the Earth apart. The centrifugal force from the rotation of the Earth (usually more than countered by gravity) would also aid in flinging the Earth apart. In the case of Earth, I would imagine this would be fairly explosive, and would be rather spectacular to watch from space. I do not know how fast it would explode, but it would almost certainly at least break apart, and probably explode. I would imagine that only the iron core would remain intact (if even that).
A planet that is not rotating quickly, and that is solid all the way through might still hold together (e.g. possibly Mercury), but it may still break apart depending on how much gas (if any) is trapped inside.
For Saturn, its rings would stop orbiting, and expand out into space. The gas would expand out into space as well, not being held by gravity. I believe this would happen very explosively, since the internal high pressure of the gas is now no longer resisted by gravity. It would likely completely explode into space, except for possibly a rocky core (which would also likely be blown apart by gasses trapped inside, and by the force of the explosion). Centrifugal force would also likely come into play, but I would imagine the explosiveness of the de-pressurized gas would be a much greater factor. This would definitely be interesting to watch from a distance!
A solid planet is kept on place and shape by electromagnetic forces, ie chemistry. Imagine a giant piece of rock. If you turn off gravity nothing change, the big rock would expand for a certain amount, and that is. Obviously this is oversimplified. If gravity was off it could have not formed depending on its history, or formed without acquiring a nearly spherical shape.