It's only in a very very borderline case that your ball could be "captured" by the gravity of some other body. Basically, if it approaches a large body, but not on a collision course, it will be deflected, but not slowed down. You would see it leaving at the same speed that it had been arriving with, but in a different direction. It would only be if it collided with enough fragments of space debris when it was close to a larger body that it could possibly drift into a closed orbit, instead of escaping again. The further out into empty space that it was, the smaller would be the gravity effects of other bodies (but never zero), so the smaller (but never zero) would be the deflections they caused.