If magnetism requires some energy to exert change of motion to attract ferrous metals, then, does gravity require energy to exert attraction, or is gravity energy itself, creating attraction through centrifugal force from the earth?
Gravity is an effect of the stress-energy tensor. Put differently, energy and momentum (they're related concepts) are the cause of gravity in general relativity. A fully charged electric battery has a very slightly stronger gravitational field than a depleted one. You may have heard that $E = mc^2$ or in as the terms are more descriptively defined in modern usage, $E^2 = m^2c^4 + p^2c^2$ . Just thinking about these equations from special relativity, you can see that more energy means more mass, which means more gravity.
Beyond that, gravitational waves carry energy. You may remember the recent discovery of gravitational waves from a black hole collision, in which about three solar masses worth of energy were calculated to have been given off as gravitational waves.
Getting back to plain old Newtonian mechanics, when masses move around in a gravitational field energy is converted from one form to another as Dean noted in their comment on the question. For example when a comet is near the sun on its highly elliptic orbit, it has high kinetic energy and low potential energy. It loses kinetic energy as it moves outward, being slowed by gravitational energy, but gains gravitational potential energy. This potential is, quite simply, a representation of the fact that it can get its "lost" kinetic energy back when it falls in again on the inbound leg of its orbit, being helped along by gravity instead of hindered when inbound.