So far, I determined that the integral converges for every $q>p+1$.
I noticed that for example for the values $p=5, q=3$ the integral still converges. There are some values for which the integral diverges, too.
I have also tried to apply the Dirichlet test and limit tests with various functions.
Any insight on how to determine the exact values of p and q for which the integral diverges/converges will be much appreciated!