sign convention that to used in the prob entirely depend on the person
in the first case both the body's velocity and the acceleration due to gravity act in downward direction which you can assume to be positive
while in the second case velocity and the acceleration acts in opposite direction till the body reaches its maximum height and then the body falls with g .Now if suppose we need to find out the height from which the body is thrown upward with velocity v and reaches the ground at time t then we can simply use the formula
h = -vt + gt^2