He agreed to give him the ball
You are correct. "To give him the ball" is an infinitive phrase that is acting as a noun and is the direct object of the verb "agreed".
He has problems repairing his car
This one is less clear. I would consider "repairing his car" to be a participial phrase acting as an adjective and modifying "problems."
I believe you could also make the case that "repairing his car" is a gerund phrase acting as a noun and an appositive to "problems" but I think the first is more likely.
A few comments.
I've never heard of an infinitive or gerund clause. In English grammar when I learned it, "clauses" were sentence units with subjects and predicates (verbs) and "phrases" were sentence units without predicates. Since infinitives and gerunds do not behave as verbs (remember, they are considered nouns), it is proper to call them "phrases".
Gerunds and infinitives are always nouns and therefore cannot behave adverbially. If an -ing word seems to be behaving as an adverb or an adjective, it is called a "participle".