1: ”Is the spirit of wisdom and revelation referring to spiritual gifts or the Holy Ghost?"....................
Biblical ‘understanding’ is either ‘natural’ - what ‘you’ reason out, either intellectually or emotionally [via senses] - or ‘revelation’, what the spirit has ‘revealed’ to you.
JOHN 14:26 But the Advocate, the Holy Spirit, whom the Father will send in my name, will teach you all things
1 JOHN 2:27 As for you, the anointing you received from him remains in you, and you do not need anyone to teach you.
When you become a ‘believer’, you need to learn much. And you will need to relearn much - (this being far more difficult!). Your ‘spirit’ is ‘reborn’- becomes a new creation’. And your ‘spirit’ can only develop [grow] using the ‘word’. So you need to start ‘renewing the mind’. Revelation means your ‘spirit’ ‘sees’ [understands] the word - not your ‘head’ [intellect]. And it’s this that Paul is praying for - that those he is writing to may grow in ‘revelation knowledge’.
But it is only through the ‘teacher’, the Holy Spirit’ that we can gain ‘revelation knowledge’.
2: ”Who is the "him" at the end of the verse?”
‘Him’ is his Father. Jesus came to reveal God as ‘Father’.
JOHN 17:25 Righteous Father, though the world does not know you, I know you, and they know that you have sent me. 26 I have made you known to them
MAT 11:27 All things have been committed to me by my Father. No one knows the Son except the Father, and no one knows the Father except the Son and those to whom the Son chooses to reveal him.
So, as per the NIV “so that you may know him better.”, or the KJV “the knowledge of him:” are both referring to, ‘pointing’ to the desire that ‘believers’ can grow in the revelation of seeing ‘God’ as their ‘Father’ - the one that can meet their ‘needs’, be there ‘source’ for these.
Meyer is even more explanatory -
πνεῦμα σοφίας κ. ἀποκαλύψ. The Holy Spirit, too (for it is not the human spirit that is here meant, as Michaelis, Rückert, de Wette,
Baumgarten-Crusius, Bleek would take it[111]), Paul is wont to
characterize πρὸς τὸ προκείμενον, Romans 7:2; Romans 7:15; 2
Corinthians 4:13; Galatians 6:1. Comp. 2 Timothy 1:7. Here: the Spirit
who works wisdom and gives revelation (1 Corinthians 2:10). The latter
is a greater result of the work of the Spirit,[112] in accordance with
which He not only by His enlightening operation furnishes wisdom
(γνῶσις θείων κ. ἀνθρωπίνων πραγμάτων καὶ τῶν τούτων αἰτίων, 4Ma 1:16;
conceived of, however, by Paul in reference to the Christian economy
of salvation, comp. Ephesians 1:8), but further, as the organ of God,
effects also special revelations of divine saving truths and purposes
not otherwise known. Harless regards κ. ἀποκαλ. as the objective
medium, which brought about the state of σοφία, so that the character
of the σοφία is more precisely defined by κ. ἀποκαλ. But in passages
like Romans 1:5, χάριν κ. ἀποστολήν, Romans 11:29, τὰ χαρίσματα κ. ἡ
κλῆσις τοῦ Θεοῦ, the discourse advances from the general to the
special, not from the thing itself to its objective medium. Logically
more natural, besides, would be the advance from the objective medium
to the subjective state, according to which Paul would have written:
ἀποκαλύψεως καὶ σοφίας. Finally, the climactic relation, which is
brought out in the two words under our view, makes the wish of the
apostle appear more fervid and full, and so more in keeping with his
mood. It is obvious of itself, we may add, that Paul here desires for
his readers, to whom in fact the Spirit has been already given from
the time of their conversion (Ephesians 1:13), a continued bestowal of
the same for their ever increasing Christian enlightenment. Comp.
Colossians 1:9. Baur, p. 437, conjectures here something of a
Montanistic element. But it was not by the Montanists that the πνεῦμα
was first regarded as the principle of Christian wisdom, etc.; it is
so already in the teaching of the whole N.T.