As you probably notice they don’t look that different in the photo (if they were celebrities, they would look more like Mary Kate and Ashley Olson standing next to each other than they look like Mary Kate standing next to Bob Saget). If you could look at them more closely, though, you would see that gabbro has larger grains in it than basalt. That is what makes them different.
The speed at which the molten rock becomes solid rock determines whether it becomes basalt or gabbro. Molten rock can also be called magma or lava. Magma is any molten rock that is below the surface of the Earth. Lava is what you call magma that has managed to rise above the surface of the Earth. Gabbros are only made by magma. Basalts can be made by magma, but they are also made by lava.
Because it is much cooler above (and near) the surface of the Earth than it is beneath it, lava does not stay molten very long. When lava comes in contact with the cold ocean water near the surface of the ocean plate, it cools very, very quickly forming the small grained rock we call basalt. The grains in the rocks are actually crystals. When molten rock cools quickly, crystals do not have a chance to grow very big.
When magma is able to intrude into the ocean plate near the bottom of the plate, the rocks of the plate are cooler than the magma, but they are much warmer than the rocks near the surface that are right under the ocean water (and farther away from the hot mantle). The magma here also cools into rock, but at a much slower speed than the lava at the surface. This gives crystals more time to grow, making the larger-grained rock known as gabbro.