Who told you? There is gravity on other planets. In fact, everything (matter) has a gravitational pull.