ISTANBUL—Turkish Prime Minister Recep Tayyip Erdogan rode around Google Inc. headquarters last spring in the company's self-driving car, tried on Google Glass eyewear and vowed to keep digitizing the economy in the country he has ruled since 2003.

Since then, the 60-year-old Mr. Erdogan has turned his democratically elected government into one of the world's most determined Internet censors.

His...