Why can copper have multiple coordination numbers?
the coordination number of for example $\ce{Cu^2+}$ can be either 4 or 6.


Allow me to preface this answer by debunking that myth.

Balamurugan and Palaniandavar published a set of interesting sterically strained trigonal planar copper(I) complexes, among them 1. Under cyclic voltammetric conditions, they observe two distinctly different oxidation potentials, one of which they attribute to the oxidation to the corresponding trigonal copper(II) complex. Unfortunately, they do not report isolation.[1]

Tetracoordinated copper(II) species are not as common as hexacoordinated ones, but they are also rather well-known. For example, Kitajima et al. synthesised the structurally interesting complex 2, a formal copper(II) and boron(III) binuclear complex. Naturally and as expected for tetracoordinated copper(II) complexes, its structure is tetragonal around both the copper and the boron centres.[2]

Slightly more interesting is the second complex Kitajima et al. were able to crystallise: it is the formal addition of a DMSO solvent molecule to complex 2 to give complex 3. Here, copper(II) is pentacoordinated and equally interestingly the coordination sphere represents a square pyramidal structure, not the usual trigonal bipyramid.[2]

I’ll skip hexacoordinated complexes, because they are damn common and just note that everybody who witnessed complex chemistry at any educational institution has come in contact with $\ce{[Cu(H2O)6]^2+}$ and $\ce{[Cu(NH3)4(H2O)2]^2+}$.

Finally, Martínez-Bulit et al. were able to synthesise an interesting heptacoordinated copper(II) complex 4. Unfortunately, the complex did not crystallise like the corresponding cobalt(II) and zinc(II) counterparts so we are left with analogy to the other syntheses, MS and IR data for establishing it’s structure. In figure 2, you can see a depiction of the coordination sphere.[3]

A variant of heptacoordinated, albeit only characterised for copper(I) to the best of my knowledge, is $\ce{[CuCp(TMS-C#C-TMS)]}$, complex 5.[4] Cyclopentadienyl — even though it is a $\unicode[Times]{x3b7}^5$ complex — should be characterised as pentacoordinating because there are five coordinating atoms. Likewise, acetylene is dicoordinating for a total of 7. It should be possible to extend the concept of sandwhich complexes to $\ce{[CuCp2]}$ 6; however, that complex is currently unknown outside of calculations.[5]


Figure 1: Structures of the complexes mentioned above.


Figure 2: Three-dimensional representation of 4’s ligand sphere.



Now why does copper(II) assume these structures? Well, you can argue things like complex stability, Jahn-Teller distortion, steric strain, electronic effects and much more. In the end, it all boils down to: if the MO scheme of a complex provides sufficient stabilisation with respect to the individual components, the complex is viable to be formed. If removing a ligand will substantially destabilise the complex, it is likely to remain inert. Unfortunately, I was unable to find a linear copper(II) complex (or any linear copper complex for that matter); however, I would assume it to exist if a ligand provided a large cavity with one coordination site and only a single anion was present to coordinate the other. Or maybe not even anions but neutral donors; the anion being $\ce{F- . SbF5}$, a very non-coordinating ion. I’m also sure that the cuprocene sandwhich complex will be synthesised given sufficient time. That would extend copper(II)’s coordination count range from 2 to 10 — always given beneficial circumstances for a certian coordination number.

So tl;dr: There is no simple explanation for the choice of exactly that coordination number.

Note that in aquaeous solution the ligand sphere of the seemingly so stable complex $\ce{[Cu(H2O)6]^2+}$ is in constant fluctuation with dissociating and reassociating ligands. Otherwise, there would be no rapid exchange mechanism that would allow the formation of $\ce{[Cu(NH3)4(H2O)2]^2+}$ upon addition of concentrated ammonia. Compare iron(II): while the hexaammin complex $\ce{[Fe(NH3)6]^2+}$ is undoubtedly stable and characterised,[6] you won’t be able to get it by reaction $\ce{[Fe(H2O)6]^2+}$ with ammonia. Instead, $\ce{Fe(OH)3}$ will precipitate, demonstrating that ligand exchange in iron(III) complexes is slow with respect to deprotonation, while in copper(II) complexes it is reasonably fast.



References:

[1]: R. Balamurugan, M. Palaniandavar, Inorg. Chem. 2001, 40, 2246. DOI: 10.1021/ic0003372.

[2]: N. Kitajima, K. Fujisawa, Y. Moro-oka, J. Am. Chem. Soc. 1990, 112, 3210. DOI: 10.1021/ja00164a052.

[3]: P. Martínez-Bulit, A. Garza-Ortíz, E. Mijangos, L. Barrón-Sosa, F. Sánchez-Bartéz, I. Gracia-Mora, A. Flores-Parra, R. Contreras, J. Reedijk, N. Barba-Behrens, J. Inorg. Biochem. 2015, 142, 1. DOI: 10.1016/j.jinorgbio.2014.09.007.

[4]: D. W. Macomber, M. D. Rausch, J. Am. Chem. Soc. 1983, 105, 5325. DOI: 10.1021/ja00354a023.

[5]: D. W. Clack, K. D. Warren, Inorg. Chim. Acta 1978, 30, 251. DOI: 10.1016/S0020-1693(00)89045-3.

[6]: G. L. Schimek, J. W. Kolis, Chem. Mater. 1997, 9, 2776. DOI: 10.1021/cm970095c.