Given two positive integers $a,b$, and an odd prime $p$, I want to know whether the number of solutions to the following equation is finite:


$X^2=a+bp^{Y}$


where $X,Y$ are variables and are integers.


I checked with google, and in the case $b=1$ this seems to follow from a result of A Baker on logrithmetic forms (1966).



A problem on the finiteness of solutions to a Diophantine equations
Yes, there are only finitely many solutions. Even more is true. For fixed nonzero $a$ and $b$, the equation
$$ x^2 = a + bz^y $$
has only finitely many solutions in integers $(x,y,z)$ with $y\ge3$. See the article on the Ramanujan-Nagell equation (and its generalizations) <https://en.wikipedia.org/wiki/Ramanujan-Nagell_equation>.


It is conjectured that there are only finitely many solutions $(x,y,z,w)\in\mathbb{Z}^4$ to 
$$ x^w = a + bz^y $$
with $\max(w,y)\ge3$ and $\min(w,z)\ge2$, but this is only known for a few small values of $a$ and $b$, such as $a=1$ and $b=-1$, which is Catalan's equation.


