Thanks all. This is what I understood from reading your replies and wikipedia, correct me if I'm wrong:

1) spaceship's speed relative to body must be larger but close to the escape velocity at the point of approach of the body used to do this maneuver. If it is too small, it will fall on the body or be captured in orbit. If too large, it will just pass by, barely changing its direction. .2c, for example, is much much larger for anything other then a black hole.

2) Assuming #1 is met, and the ship's speed is larger than escape velocity of the star at desired orbit, it is still possible to put the ship into that orbit by gravity assist IF ship speed does not exceed 2U+V where U is orbital speed of the body orbiting around star and V is less than escape velocity from the star. 2U is maximum that can be stolen away from the ship's speed in order to decelerate it. Final veloctiy can be adjusted by playing with angle of approach.

3) Trying to put yourself in orbit around a planet has nothing to do with any of this, it just requires to be in the sphere of influence of the planet with relative speed below its escape velocity. However, #2 can be used as means of accomplishing this.

Neilsox, I really liked your example. At first I didn't understand why you used black holes, but then I realized that because gravity becomes weak proportionally to square root of the radius, no couple of planets or stars can orbit each other at a speed as large as .3c. I looked up escape velocity of our sun, and it's something like .002c at the surface of the sun (which would be a terrible place to turn around.)