Let $\frac ab$ with $\gcd(a,b)=1$ be a rational such that it satisfies $$54\left(\frac{a}{b}\right)^n+P\left(\frac{a}{b}\right)=315$$ so that $$54a^n+b^nP\left(\frac{a}{b}\right)=315b^n$$
We know that $b^nP\left(\frac{a}{b}\right)$ is an integer, and since $P(0)=0$, the constant term is $0$, so it is not hard to see that both $a$ and $b$ divide $b^nP\left(\frac{a}{b}\right)$ (this argument is true because $\deg(P)\leq n-1$). Thus, since $\gcd(a,b)=1$, $a|315$ and $b|54$. Now we are left with counting the possibilities for $a$ and $b$, which I'm sure you're capable of.
To complete this answer, I'll include the the counting the possibilities for $a$ and $b$. Notice that $\gcd(54,315)=9$ (remember: $\gcd(a,b)=1$), and so we'll need to split cases. Case 1: $b$ doesn't have a factor $3$. We have $\sigma_0(2)=2$ possibilities for $b$ (where $\sigma_0$ is the
divisor counting function) and $\sigma_0(315)=12$ possibilities for $a$ (total $2\cdot 12=24$ possibilities). Case 2: if $3|b$, then we have $\sigma_0(54)-\sigma_0(2)=6$ possibilities for $b$, and $\sigma_0(35)$ for $a$ (total $6\cdot 4=24$), so that makes $48$ possibilities.