Walgreens plans to close about 1,200 locations over the next three years as part of a cost-cutting plan, the company said Tuesday.