It all depends on the directions you’ve identified as positive and negative. With vectors, the positive and negative signs don’t indicate the magnitude of the value, rather it’s direction. Gravity is a force, which is a vector. Via convention, moving to the right is positive as well as moving up (think about it like 4 quadrant graphs). Left and down is negative.
Therefore, it’s -g because the force is always acting DOWNWARDS on the object.