In your mid-to-late 20s. Your fertility starts to drop off after 30, so you want to marry sooner to have a stable family if you're going to have children. Marrying before 20, though, results in sky-high divorce rates.
Statistically, the person you are going to marry is someone you are dating, know or are introduced to by a friend from your 20s. So don't try to swing through a bunch of fun relationships if you want to find a partner. This is musical chairs, and refusing to take the great guy while looking for a perfect one risks you being alone at the end.
Note, most marriages do not end in divorce. Per Shaunti Feldman's research, if you're both college graduates, you have a 75% chance of staying married until one person's death while second marriages have a 50% chance of divorce. If you both have less than a high school degree, you're unlikely to marry and almost certain to divorce.
The confusion that half of all marriages end in divorce came from 1970s status from when marriage rates dropped and divorce rates to the point divorce rates were half marriage rates. But marriage rates then rose and divorce rates fell.