If you consult a dictionary to look up `gravity’ you will likey see both：
引力 – いんりょく …and…
重力 – じゅうりょく
Note that the kanji meanings are logical here: ‘pull+power’ & ‘heavy+power’ respectively.
But which should you use? The answer is that you normally use 引力 in everyday conversation while 重力 is more of a technical science word.