Ally Financial has agreed to sell its credit-card business to a subsidiary of credit-card servicer CardWorks for an undisclosed amount.