As noted above, many sites will give you sunrise and sunset times, but both refer to when the entire Sun is below the horizon.
You appear to be looking for when the Sun (or Moon) is touching the horizon, not when it goes completely below the horizon.
The Sun sets when its geometric position is 50 minutes of arc below the horizon (because of refraction and the Sun's angular diameter), so the Sun touches the horizon when its geometric position is 18 minutes of arc below the horizon.
When that happens, the object you want to photograph should have an angular diameter of 16 minutes of arc, just like the Sun.
One caveat: because of refraction, the Sun's diameter isn't exactly 16 minutes of arc when it starts setting, but should be fairly close.