Context : Aims : We determined the K _ { s } band luminosity function ( LF ) , and inferred the corresponding stellar mass function , of cluster galaxies at redshift z \simeq 1.2 , using near–infrared images of three X–ray luminous clusters at z = 1.11 , 1.24 , 1.27 . Methods : The composite LF was derived down to M ^ { * } +4 , by means of statistical background subtraction , and is well described by a Schechter function with K _ { s } ^ { * } = 20.5 ^ { +0.4 } _ { -1 } and \alpha = -1.0 ^ { +0.2 } _ { -0.3 } . Using available X–ray mass profiles we determined the M/L ratios of these three clusters , which tend to be lower than those measured in the local universe . Finally , from the K _ { s } band composite LF we derived the stellar mass function of cluster galaxies . Results : With these data , no significant difference can be seen between the cluster galaxies LF and the LF of field galaxies at similar redshift . We also found no significant evolution out to z \simeq 1.2 in the bright ( < M ^ { * } +4 ) part of the LF probed in this study , apart from a brightening of \simeq 1.3 mag of the characteristic magnitude of the high redshift LF . We confirm , and extend to higher redshift , the result from previous work that the redshift evolution of the characteristic magnitude M ^ { * } is consistent with passive evolution of a stellar population formed at z > 2 . Conclusions : The results obtained in this work support and extend previous findings that most of the stars in bright galaxies were formed at high redshift , and that K _ { s } –bright ( M > 10 ^ { 11 } M _ { \odot } ) galaxies were already in place at z \simeq 1.2 , at least in the central regions of X–ray luminous clusters . Together with recent results on the field galaxies stellar mass function , this implies that most of the stellar mass is already assembled in massive galaxies by z \simeq 1 , both in low and high density environments .