Amazon.com Inc. is freezing staffing levels in its profitable advertising business, according to a person familiar with the matter, showing that the world's largest e-commerce company is taking more drastic measures to align expenses with slowing sales.