Summary:

Once you have acquired the Education tech, you may engage in a Research Agreement with another civ, as long as you both have an Embassy and a Declaration of Friendship. A Research Agreement costs each side Gold (if you don't have the required Gold, you can't be part of an agreement).

The Research Agreement lasts 30 turns on Standard speed. When it is finished, you gain Research based on the total Research you and your partner produced during the agreement. However, you cannot get more Research from your partner than what you produced yourself.