Jennifer Lopez and Ben Affleck have reached a settlement agreement in their divorce, about four months after Lopez petitioned to end their two-year marriage, according to court documents obtained by CNN.