There are several issues here: whether you were "out of status", whether you accrued any "unlawful presence" and how much, and whether you can get a visa.
Assuming you abided by all the rules of J1 status during your program, your J1 status ended 30 days after you completed your program as indicated on your last DS-2019. After those 30 days, you became "out of status", which means you were deportable (though you weren't deported), and if any future forms asked whether you violated the terms of your visa, you have to say yes.
Even though you were "out of status", you did not accrue "unlawful presence", because generally, you must stay past the date on your I-94 in order to automatically start accruing "unlawful presence", and you had no date on your I-94 (you had "D/S"). "Unlawful presence" can also start accruing under 2 circumstances: 1) if you applied for some benefit to USCIS and it was denied along with a determination that you are out of status, or 2) if you were given a final order of deportation in immigration court. Neither of these happened for you, so you never started accruing "unlawful presence". The term "unlawful presence" is basically only relevant for the purposes of bans. If you accrued 180 days of "unlawful presence" and left the US, you would have a 3-year ban, and if you accrued 1 year of "unlawful presence" and left the US, you would trigger a 10-year ban. But in your case since you are not accruing "unlawful presence" (due to having "D/S"), you would not trigger a ban even if hypothetically you left the US years after your program ended.
Not having a ban doesn't mean you will get a visa in the future. Most types of nonimmigrant visas are subject to "immigrant intent", where you have the burden of overcoming the presumption that you intend to immigrate. Basically, this is a catch-all reason to deny people visas if the officer subjectively feels that the person doesn't have strong enough ties to their country, or is not sufficiently trustworthy, etc. If you have had any immigration violations in the past, or otherwise did something in the US the officer didn't approve of, that increases the chances that the officer will deny the visa using this reason. But since this ground of denial is completely subjective, it does not correspond to legal concepts like whether you were "out of status" or had "unlawful presence", so the above discussions about those don't really tell you anything about whether you will get a visa or not.
I was not entirely sure when I should have left
. No consular officer is going to buy that excuse. If you did not know, you should have asked.