(Details:
You can go back once you're covered by public insurance for 12 months, no matter through which status, so family insurance helps get these months. For family insurance your income needs to be below EU435/month + some exceptions.
The outcome changes a bit when you're older than 45 because you need ~20 years (in raw terms: more than 90% of the second half of your working life) in total in the public insurance scheme to be able to apply for the "public health insurance for pensioners" system when you retire. That complicates matters.
Even more details for people not used to the German health insurance system:
By default people are in the public health insurance system. Exceptions are self-employed folks, public officials and people with income beyond the cap mentioned upthread: they can choose whether to use the public system or some private health insurance.
The reason why you can't just move from private insurance to public insurance is that otherwise the private insurers would try to get ahold of all the healthy youngsters and their (usually significant) money while offloading them to the public system as soon as they start to cost more than they bring. That would break the economics of the public insurance system.)
Basically, the insurance cost is a percentage of income (14.6%) up to 4,537.50 €/month (gross income). If you earn more, your absolute health insurance costs will stay the same at 662.48€.
Keep in mind that in Germany, half of your health insurance is covered by your employer (by law).
Edit: The above is for the "public" insurance system, as noted in the comments. If you are above the Beitragsbemessungsgrenze, you can opt for private insurance which will very likely be significantly cheaper while you are young. But it carries the risk of steep price hikes which you might not be able to handle later in life (think retirement). And the path back into the public system is not straight forward and might include having to file for personal bankruptcy or similar drastic measures.