The question has been answered well but for the record, I'm adding an alternate solution using conditional probability. Let $E[N_k]$ be the expectation of the number of tosses for having $k$ heads. Let random variable $X_1$ denote the result of the first toss.
$$E[N_k] = E[N_k|X_1=H].P(X_1=H) + E[N_k|X_1=T].P(X_1=T)$$
When we know that first toss gave $T$, we still need $k$ more heads and the expected value rises by one, i.e. $$E[N_k|X_1=T] = 1 + E[N_k]$$
And when first toss gives $H$, we need $k-1$ more heads and therefore $$E[N_k|X_1=H] = 1 + E[N_{k-1}]$$
Using above, we get
$$E[N_k] = (1+E[N_{k-1}]).p + (1+E[N_k]).(1-p)$$
$$E[N_k] = E[N_{k-1}] + \frac{1}{p}$$
As $E[N_0] = 0$,
$$E[N_k] = \frac{k}{p}$$