Why doesn't it violate Law of Conservation of Energy?
Isn't it energy that comes out of nowhere?
Gravity manifests as a force, not an energy. Ie, a book sitting on a table experiences a constant force from gravity (and the table), but no energy is being expended.
It comes from potential energy.
You should understand exactly what the law of conservation of energy tells us. It tells us that *if we have a certain situation* and we calculate a quantity, called energy, for that situation, and then the situation evolves, and somewhat later, and we calculate the same quantity again, we find the same number.
If the interactions that make the situation evolve from the first to the second state are such that we do indeed find the same number, we say that those interactions "conserve energy".
It can be shown that if you move an object from a position A to B, then the work done by gravity will be independent of the path: it depends only on the points A and B. So we can define gravitational energy in general point B as work done by gravity when the object moves from A to B (we can chose any A, this just affect a constant in the energy). Consequently energy will be conserved once we add gravitational energy.
Separate names with a comma.