On his arrival, Jesus found that Lazarus had already been in the tomb for four days.
Burial usually followed death as soon as possible because of the climate and its effects on the body. (Note the example of Ananias and Sapphira in Acts 5:6, 10). Thus allowing for a day journey to Jesus by the messenger, 2 days wait before departure, and another day in transit for Jesus to Bethany, a total of 4 days; Lazarus must have died the same day the messenger departed from the sisters with their message for Jesus.
Acts 5:6 Then the young men came forward, wrapped up his body, and carried him out and buried him.
Acts 5:10 At that moment she fell down at his feet and died. Then the young men came in and, finding her dead, carried her out and buried her beside her husband.
The reason Jesus delayed was His obedience to the Father. One of the reasons the Father had Jesus wait that particular period of time may have been due to a Jewish belief that the soul of the dead remained near the body for 3 days, hoping to be able to return, but when it saw decomposition disfiguring the face, which according to the Mishnah occurred on the fourth day, it abandoned all hope and departed. Thus the only hope for resurrecting a corpse after 4 days was direct divine intervention.