To be technical, a $p$-th quantile is any point $x_p$ such that $P(X \le x_p)=p$. There may be more than one such $x_p$, but in our case there is only one.
So for our random variable with exponential distribution, we want to find $x_p$ such that $$\int_0^{x_p} \lambda e^{-\lambda x}\,dx=p.$$ Integrate. We get $1-e^{-\lambda x_p}$. Set this equal to $p$, and solve for $x_p$. The equation $1-e^{-\lambda x_p}=p$ can be rewritten as $$e^{-\lambda x_p}=1-p.$$ Take the natural logarithm of both sides, and solve for $x_p$. We get $$x_p=\frac{-\ln(1-p)}{\lambda}.$$
For a more general random variable $X$, we want to solve the equation $F_X(x_p)=p$, where $F_X$ is the cumulative distribution function of $X$. It may not be possible to solve this equation by "exact" methods, but usually we can at least get a good numerical approximation.