What's the time horizon of the probability of default implied from a CDS spread? Given CDS = PD*(1-R), if I use a 5yr CDS spread in the formula, is the implied PD the probability that that name defaults within the next 5 years or 1 year given it represents the annual premium?
CDS quotes are observable. But none of: probabilities of default, hazard rates, loss given default/recovery, etc are observable.
To get some kind of (risk-neutral) probabilities of default, many people make a lot of assumptions, in particular, that the hazard rate is constant (or if you're lucky enough to have CDS quotes at more than one tenor, then piecewise constant between quotes). Then they solve numerically for the hazard rates that explain the obsevable quotes and assumptions. Interest rates play a minor role. Some people use more sophisticated assumptions, such as term structure of recovery, or fancier curve shapes.
Once you have the hazard rates, it's easy to read off both the probability that there will be a default within $n$ years and the marginal probability that, provides there has not been a default until $n$, there will be one between $n$ and $m$.
The formula you cite is a very rough approximation of the probability that there will be a default before the maturity if the CDS.