When did the apostles come to believe that Jesus is God? Did they believe it before he was resurrected?
On all of your questions I am going to have to say “I do not know.” Now, I can make some pretty good guesses, but, for the most part, we cannot know for sure what the mindset of the apostles was before Jesus was resurrected. There are some solid hints, but no smoking gun statements. We are going to have to settle for this limitation.
I will try to answer question 1-3, but I want to answer question #4 first. The answer to this question is that it is an interesting one, but no, we do not need to worry about this. All we need to worry about is this: What is the truth about Jesus? That is all that is important. What person X believes at a certain time has no effect on what is true. What matters is the truth, and the truth is found in the inspired Scripture. What is important is what John believed when he wrote the Gospel of John. What is important is what Paul believed when he wrote Romans. What is important is what Peter believed when he wrote 1 Peter. This is all that is important. What apostle or disciple X believed at an earlier time is an interesting question, but not an essential or even an important question.
1. I am not exactly sure what Peter meant in Matthew 16:16. What I know is what he said, and that Jesus approved of what he said. We also can get a general understanding of what a Jew in the first century would have thought of this. Here is what I would say. In saying this, Peter acknowledged Jesus to be the expected Messiah/Savior of the Jewish people (and of all mankind, although he may not have gotten that!). He also acknowledged that Jesus was a unique and by far the most important person ever to walk the earth. Whether he saw the “Son of God” to be God-in-the-flesh or not, I am not certain.
2. I am not certain, but we can say the idea that he was God was surely emerging in the minds of the apostles immediately after the resurrection. We can know that from the words of Thomas in John 20. “My Lord and my God.” Whether they understood this before the resurrection will have to remain uncertain.
3. I think I already answered this one.