Equation relating probability of fixation and number of generations
From Hartl and Clark's 'Principles of Population Genetics' Third Edition chapter 7: Kimura and Ohta (1969) showed that the mean time in generations until the allele of frequency p is fixed (ignoring cases where the allele is lost) is:

$$t_1(p) = -4N[(1-p)log(1-p)]/p$$

The mean time to loss of the allele is:

$$t_0(p) = -4N[p \cdot log(p)]/(1-p)$$

Thus the mean persistence time of an allele is:

$$t(p) = -4N[p \cdot log(p)+(1-p)log(1-p)]$$

Hopefully I didn't make any typos there, but I reccommend this book to learn all the ins and outs of popgen. There is a PDF of the third edition online in an archive. For more book recommendations, please have a look at the post Books on population or evolutionary genetics?

You can also find these equations in the original article: Kimura and Otha (1968)