Amazon has offered to buy TikTok as the social media app faces a looming deadline for divestment from its Chinese ownership or face a U.S. ban, the New York Times reported.