Notice that the one-point compactification happens one step earlier, when one considers fields on \(\mathbb{R}^4\) whose field strength vanishes at infinity. Since the question is about purely topological aspects, this is equivalent to considering gauge fields on the one-point compactification of \(\mathbb{R}^4\)which is \(S^4\).
Now gauge fields mathematically are principal connections on principal/vector bundles. There is a connection on any bundle and a unique self-dual one, so we may concentrate on classifying the underlying principal bundles.
This is done by degree-1 Cech cohomology with coefficients in the sheaf of gauge-group valued functions. While in general this is hard, over spheres this is particularly simple: the clutching construction says that it is sufficient to consider the cover of the 4-sphere given by two hemispheres that overlap a little at the equator.
Since everything is topological, you may think of covering \(S^4\) by the big hemi-4-sphere which is just \(S^4-\{\mbox{north pole}\}\) (this is homeomorphic to \(\mathbb{R}^4\)) together with the small hemi-4-sphere which is a tiny 4-disk around the northpole. This indeed gives the picture which one has from the physics, where the northpole is the "point at infinity" and we are working with fields that vanish at infinity.
Now by Cech cohomology, any G-principal bundle on the 4-sphere is defined by its transition function on the double overlap of these two patches (the two hemi-4-spheres). That double overlap is homeomorphic to \(S^3 \times (0,\epsilon)\) hence to the 3-sphere times a little thickening coming from the fact that the two hemi-4-spheres don't just touch but are required to overlap a little bit.
But such transition functions \(g : S^3 \times (0,\epsilon) \to G\) are also defined only up to gauge transformation, and a standard argument shows that their equivalence class is given simply by their homotopy class \([g] : S^3 \to G\). This is equivalently an element in the third homotopy group \([g] \in \pi_3(G)\) and hence these are the elements that classify the G-instanton sectors.
Now for the special case that \(G = SU(2)\) it so happens that as spaces this is \(SU(2) \simeq S^3\)
And so that is the reason of why SU(2)-instantons on Minkowski space are classified by an instanton number in \(\pi_3(S^3)\simeq \mathbb{Z}\).
(By the way, the analogous argument with the 4-sphere replaced by the 2-sphere and SU(2) replaced by U(1) yields the magnetic charge quantization of the Dirac monopole.)
Finally, with the principal bundle constructed this way you want to equip it with a principal connection \(\nabla\), the actual gauge field. You may choose a self-dual connection if you care, but for the following any other connection will do, too. If you use the standard formula for adding a connection to a bundle given by transition functions as above, then it will automatically satisfy the condition that it becomes pure gauge as one approaches infinity.
Given that, you may produce the familiar differential 4-form \(\langle F_\nabla \wedge F_\nabla\rangle\) which is locally given by the expression familiar from the physics textbooks \(\mathrm{tr}(F_A \wedge F_A)\). It is Chern-Weil theory which says that the integral of that 4-formover the 4-sphere equals the instanton number that we obtained from Cech cohomology above.
For more exposition of what is going on see these slides, where the YM-instanton appears on slide 13 (29 of 52).