A unit of Johnson & Johnson will pay $360 million to resolve an investigation into its financial support of a charity.