Theorem (Lagrange):
Let $a,b,c$ be squarefree (positive) pairwise coprime integers. Then $ax^2+by^2=cz^2$ has a nontrivial rational or integral root if and only if
$$
\left(\frac{bc}{a}\right)=\left(\frac{ac}{b}\right)=\left(\frac{-ab}{c}\right)=1,
$$
where this should mean that $bc$ is a quadratic residue modulo $a$, etc. (it is better to use the notation $bc\, \square \, a$, $ac\, \square \, b$ and $-ab\, \square \, c$).
For, say, the example $5x^2+7y^2=13z^2$ we have
$$
\left(\frac{7\cdot 13}{5}\right)=\left(\frac{5\cdot 13}{7}\right)=\left(\frac{-5\cdot 7}{13}\right)=1
$$
so that there is a nontrivial integer solution. For further references, also on this site, see here:
Clarification of Legendre's theorem re: $ ax^2+by^2=cz^2$
Note that there are versions with the wrong sign, see Will's correction!
Solutions to $ax^2 + by^2 = cz^2$