The casting of a gate spell has two effects. First, it causes an interdimensional connection between the plane of existence the wizard is on and the plane on which dwells a specific being of great power; thus, the being is able to merely step through the gate or portal from its plane to that of the caster. Second, the utterance of the spell attracts the attention of the sought-after dweller on the other plane. When casting the spell, the wizard must name the entity he desires to use the gate and come to the wizard's aid. There is a 100% certainty that something steps through the gate. Unless the DM has some facts prepared regarding the minions serving the being called forth by the gate spell, the being itself comes.
If the matter is trifling, the being might leave, inflict an appropriate penalty on the wizard, or attack the wizard. If the matter is of middling importance, the being can take some positive action to set matters right, then demand appropriate repayment. If the matter is urgent, the being can act accordingly and ask whatever is its wont thereafter, if appropriate. The actions of the being that comes through depend on many factors, including the alignments of the wizard and the deity, the nature of his companions, and who or what opposes or threatens the wizard. Such beings generally avoid direct conflict with their equals or betters. The being gated in will either return immediately (very unlikely) or remain to take action. Casting this spell ages the wizard five years.