You may arbitrarily give any world or fleet you own to any player you have met in the game. The ownership is transferred without question.
There are several important limitations on gifts. You may not fire or move a fleet in the same turn that you give it away. You may not fire with a world's I-Ships or P-Ships in the turn that you give it away (you may still build with its industry, however).
You may only make up to two gifts per turn.
Gift exchanges occur at the end of the turn. If the world is captured from you the same turn that you give it, the gift fails.