You use acceleration due to gravity in problems that involve anything falling, or anything with any vertical motion.
You do not need to consider acceleration due to gravity in problems where all of the motion is only horizontal AND friction is not involved.
Acceleration due to gravity is used in problems involving falling or vertically moving objects, while it is not utilized in purely horizontal motion problems where friction is absent. An example of its use is calculating the fall of a dropped ball. In contrast, when analyzing a car moving at constant speed on a flat road, gravity does not play a role.
;