Teva Pharmaceuticals will pay New York $523 million during an 18-year span for its role in helping fuel the Empire State's opioid crisis, Attorney General Letitia James said Thursday.