You don't "invest" in health insurance. You buy it. And you buy it as soon as you are no longer covered by a parent's policy or an employer-offered plan. There's no particular age that you should do this.
For example, let's say that while you were in college, you were covered either by your parents' policy or a plan offered to students through your university. You graduate and get a job, and your employer offers health insurance to employees. You pick a plan and may or may not have to make a contribution to the cost of it. If you do, that cost will be deducted from your paycheck.
Then, several years later, let's say at the age of 28, you decide to go free-lance or start your own business. At that point, you will have to buy health insurance for yourself.
If you go free-lance earlier and are no longer eligible to be on your parents' plan, you'll have to buy health insurance earlier.