The short answer is - we are not told when the decision of the Godhead decided to make Jesus the Messiah and propitiation for sin. However, we have some strong hints:
- Ps 110:1 - The LORD said to my Lord: “Sit at My right hand until I make Your enemies a footstool for Your feet."
- Ps 2:2, 7-9 - The kings of the earth take their stand and the rulers gather together, against the LORD and against His Anointed One. ... I will proclaim the decree spoken to Me by the LORD: “You are My Son; today I have become Your Father. Ask Me, and I will make the nations Your inheritance, the ends of the earth Your possession. You will break them with an iron scepter; You will shatter them like pottery.
These texts are quote several times in the NT, including Acts 2:34, 35, and suggest that Jesus was appointed Messiah and the sacrificial Lamb before the time of David. In fact, the NT suggests it was well before David's time:
- 1 Peter 1:20 - He was chosen before the creation of the world, but was revealed in these last times for your sake.
- Eph 1:4 - For He chose us in Him before the foundation of the world to be holy and blameless in His presence.
- Rev 13:8 - All inhabitants of the earth will worship the beast--all whose names have not been written in the Lamb's book of life, the Lamb who was slain from the creation of the world.
See also Matt 25:34, 13:35, Heb 4:3, etc. Thus, it appears that Jesus was appointed Messiah "before the foundation of the world".