Initially, the question may be asked of a critic, with a certain defining context associated with modernity and the Western world. In our daily experience, "suicide" comes with specific associations: A person who is mentally unstable, depressed, or otherwise in some sort of mentally or spiritually undesirable state. Thus, a critic who argues that Jesus committed suicide may do so under the pretense that if the answer is "yes," it in some way implies that Jesus suffered from some sort of mental instability.
The immediate problem with this, of course, is that this is a modern view. While there were undoubtedly mentally unstable people who killed themselves in the ancient world, suicide was more widely perceived as a noble way to die under certain specific circumstances. The samuari warrior, the Roman gladiator, and the Greek philosopher Socrates might all be viewed in these terms. Even today, the well-worn example of the soldier who throws himself on a grenade to save others is, technically, definable as a suicide; but because of the aforementioned connotations of that word, people tend to avoid that term when describing a death associated with heroic or honorable measures.
The point is, that in the end, even answering "Did Jesus commit suicide" with a "yes" does not serve any rhetorical purpose in establishing e.g., mental instability. As related in the New Testament, even a human Jesus would have perceived his cause as a noble one worth giving his life away for, and so would have fit the mold of the samurai, or of Socrates. With that in mind, let us now address claims and questions associated with this overall issue.
Since Jesus knew he was going to die, and freely went to his death when the time came, he committed suicide.
Under these circumstances, the appeal to divine foreknowledge seeks to clinch the case, but it is really beside the point. A person who steps in to defend someone from another person with a gun surely knows there is a high likelihood that they may die in the effort, but this does not place them any closer to "suicide" (as technically, rather than metaphorically, defined) than someone who performs the same act with a bulletproof vest.
The point is, foreknowledge is not a defining criterion for a suicide. We can see this further in the next question:
John 10:17-18 has Jesus saying he lays down his life. Isn't that suicide?
Here is where we run into that rather fuzzy area, one might say…the difference between suicide and noble sacrifice. Let's bring that into a modern narrative setting. In the movie Armageddon, the character played by Bruce Willis was compelled to stay behind on an asteroid as the rest of his crew left, in order to be assured that it would be destroyed.
Willis' character had sufficient foreknowledge to know he would be resigning himself to death, and, he also could be said to have laid down his life. Yet what modern person would call that a "suicide"? Given the pejorative connotations of the word today, none would -- not unless they wished to be perceived as boorish and insensitive.
But suicide is always morally wrong. Jesus would never have done that!
Anyway, based on what we have discussed, Jesus' death was not suicide. However, there is a due caution to be observed here, as the modern person does not always understand the difference between a suicide and a noble death. Certain critics are apt to argue that even the noble samurai's death is a moral wrong.
In this regard, one might also consider that certain Biblical deaths, while technically able to be called suicide, are seen in a noble light because of the purpose they served. Samson stands out as a particularly good example of one who redeemed himself in a death that was essentially self-caused. In contrast, self-inflicted deaths by moral cowards like Judas are seen in a poorer light, precisely because they were not honorable.
So, what are we left with? In the end, if we are to account for all the examples -- ranging from Jesus to Socrates to the samurai -- "suicide", as defined, seems to require that a person: