My best guess would be Prince's Islands. Although I didn't wanna spend time on swimming cause there were so many things to see and do.
There are a couple of beaches right near the city.
My neighbor, Ali, a native of Istanbul says that there are places on the Marmara Sea near the city, but that many are polluted, and swimming is best done in a hotel pool. The best beaches in Turkey are on the Mediterranean Coast.
When you're planning to swim? Cause it's still quite cold there...
I've been to the largest of the Prince Islands in March - Buyuk Ada - and saw lot of beaches there. It's easy to be reached by a ferry from the Kabatas. THe island is wonderful - you can rent a bike to get to the beaches and find a really wonderful place. But in spite of it's in the open sea it's still very close to Istanbul - so I don't know what to say about pollutions. As for me - I would swim anyway. But I'm from Ukraine- we have Chernobyl so we're stronger than others
As everyone else has mentioned the water is highly polluted because Marmara region is the most industrialized region in Turkey so that gives you an idea of the condition of the water. I would recommend that you drive out of the city and swim in a beach on the Black Sea coast.
The Black Sea is the coldest sea in Turkey. Personally I can't swim in such cold water.
There are some aqua parks that host big swimming pools.
July and August are the best months to swim. If you have time, any place on the Mediterranean coast would offer you better beaches.