The future value (A) of a one-time investment of principal amount P at interest rate r compounded n times per year for t years is ...
... A = P(1 +r/n)^(nt)
Putting your given numbers into the formula, we have
... 876.34 = 300(1 +.06/4)^(4t)
Taking logarithms, this becomes the linear equation
... log(876.34) = log(300) + 4t·log(1.015)
Solving for t in the usual way, we get
... log(876.34) -log(300) = 4t·log(1.015) . . . . . . . subtract the constant term on the right
... (log(876.34) -log(300))/(4·log(1.015)) = t ≈ 18.00 . . . . divide by the coefficient of t
It will take <em>18 years</em> for the $300 CD to reach a value of $876.34.