Whether you use gravity, or acceleration in general, as a positive or negative value depends on whether the acceleration is, for a given object, an accelerating or decelerating force. That is, it depends on the direction of acceleration relative to the velocity.
In other words, both velocity and acceleration are vectors, which means their direction is important. Let's say you have an initial velocity going in one direction:
(Pretend these arrows are vertical)
--- velocity ---> (25 m/s up)
The you introduce an acceleration in the opposite direction:
<--- acceleration --- (9.8 m/s^2 down)
In your equations, this would be negative acceleration because the acceleration vector is the opposite direction to the velocity vector. So you can work out how long it will take the ball to reach it's peak height using the equation:
v = u + at
Initial velocity (u) = 25 m/s
Final velocity (v) = 0 m/s
acceleration (a) = g = -9.8 m/s^2 (negative acceleration, opposite direction to the velocity)
So this equation will tell you how long it takes for the ball to slow down from 25 m/s to 0. Solving for t, the equation becomes:
0 = 25 + (-9.8t)
-9.8t = -25
t = 25/9.8
= 2.55 seconds
Conversely, we can work this out in reverse by working out how long it will take for a ball falling from its peak height, with an initial velocity of 0 m/s, until it reaches a final velocity of 25 m/s. The vectors in this case look like this:
<--- final velocity --- (25 m/s down)
<--- acceleration --- (9.8 m/s^2 down)
Initial velocity (u) = 0 m/s
Final velocity (v) = 25 m/s
acceleration (a) = g = 9.8 m/s^2 (positive acceleration, same direction as the velocity)
v = a t
25 = 9.8 t
t = 25/9.8 = 2.55 seconds
So this is the time taken for one half of the ball's journey. The total flight time will be 2.55 seconds going up, then another 2.55 seconds going down.
You can now work out how high it would reach on earth using the equation
s = ut + 1/2at^2
The easiest way is to calculate this by working out how far the ball will fall in 2.55 seconds, since then the initial velocity (u) will be 0, and thus simplifies the equation to
s = 1/2at^2
I'll leave this for you to do. Solving this problem for the moon is the same, but you need to redo one of the earlier equations using the moon's gravity, rather than earth, to get the time.