The ball stops on the horizontal surface because of friction between the ball and the surface. Friction acts opposite to the direction of motion and slows the ball down. The force of friction depends on the nature of the surfaces in contact: friction is greater on rough surfaces and smaller on smooth surfaces.
(i) To make the ball stop before A: Increase the friction on the horizontal surface. For example, spread a piece of cloth, a towel or a layer of sand on it. The rougher surface slows the ball down more quickly, so it stops before reaching A.
(ii) To make the ball stop after crossing A: Decrease the friction on the horizontal surface. For example, cover it with a smooth glass sheet or a polished ceramic tile. The ball is slowed down less, so it rolls past A before stopping.
In both cases the ball is released from the same point P and only the horizontal surface is changed, so the change in the stopping point is caused by the change in friction alone.