BP, the British oil company, said Thursday it would pay $4.5 billion in fines and other payments to the United States government and plead guilty to 14 criminal charges in connection with the giant oil spill in the Gulf of Mexico two years ago.