Temporary gain control effects, what happens if I give the permanent to another opponent before the effect ends?
In both cases, the opponent you gave the permanent to will keep it.
When you take control of the permanent, you create a continuous control-changing effect that gives you control of the permanent. When you give the permanent to another player, you create another continuous control-changing effect that gives control of the permanent to that player. Once the first effect ends, either because the Act of Treason time runs out, or the Control Magic is destroyed, the second effect keeps working, so the opponent you gave the permanent to will still control it.