Psalm 102:1-11 is the prayer of an afflicted person whose strength is failing. He describes days vanishing like smoke, bodily weakness, sleeplessness, isolation, reproach from enemies, and the sense of being lifted up only to be cast down. The psalm's immediate subject is an individual sufferer pleading with God in severe distress.
John 19:16-30 recounts Jesus' crucifixion and death, and Christians may hear meaningful echoes between the psalm's anguish and the physical and emotional suffering of Calvary. John, however, does not cite Psalm 102:1-11 as a prophecy of the crucifixion. The relationship is therefore typological. This is important because the later portion of Psalm 102 is explicitly applied to Christ in Hebrews 1:10-12; the New Testament gives the psalm a Christological dimension, but not every detail of its opening lament should automatically be treated as a specific prediction of Jesus' passion.