Ich gebe meinem Vater das Zeugnis ab.
oder
Ich gebe das Zeugnis bei meinem Vater ab.
It seems both are correct. Which one is correct and why?
Ich gebe meinem Vater das Zeugnis (ab).
Ich gebe das Zeugnis bei meinem Vater ab.
Both are correct. If the verb action means passing something, you can be pretty sure it's possible (or even required) to use a dative object. It acts as the receiver of the accusative object then. It's one of the very few case functions in German with a simple usage rule. You can even extend this to verbs with a lonely dative object as
Ich helfe meinem Vater.
which you can think of as
Ich gebe meinem Vater Hilfe.
In both cases, meinem Vater is the receiver of help.
Yes, both are correct, but the first one is less correct in terms of style. ONe would rather say
Ich gebe das Zeugnis meinem Vater.
You cannot know this from a rule. There is no other way than learning the valences (i.e which objects in which cases a verb does accept) of a verb together with the meaning of the verb. It is part of the vocabulary, and I think there is no general rule which verb will accept which cases and which prepositions. Though, the prepositions themselves are rather stable in the case they demand.
Just as a side note: In your example, both bei meinem Vater and meinem Vater are dative (Dativ) case!