McKinsey agreed to pay $650 million as part of a deferred prosecution agreement, according to court documents filed Friday.