Depends on weather, time of day, and sea state, also whether there is radar on the escorts.
There is no constant distance, but generally if you can see them, you may be seen yourself.
To minimize this possibility, try to attack at night on the surface and at a depth of 7 meters(decks awash).
This is the way I approach it.