It depends on the court and the context. If the student speech is deemed to be school-sponsored or endorsed by the school, the student prayer would violate the establishment clause. Some courts have determined that purely student-initiated speech would not run afoul of the establishment clause.
Two federal appeals court decisions show how the courts are divided on this issue.
In October 2000, the 9th U.S. Circuit Court of Appeals rejected a First Amendment challenge brought by students in California who were denied the right to make a religious speech at graduation. The court determined that school district officials reasonably prevented the student’s religious speech to avoid violating the establishment clause. The court determined in Cole v. Oroville Union High School that even "if the graduation ceremony was a public or limited public forum, the District’s refusal to allow the students to deliver a sectarian speech or prayer as part of the graduation was necessary to avoid violating the Establishment Clause."
However, in May 2001, the 11th U.S. Circuit Court of Appeals refused to strike down a Florida school district policy allowing an elected student to deliver an unrestricted message at graduation. The court in Adler v. Duval County School Board determined that "it is impossible to say that … [the policy] on its face violates the Establishment Clause without effectively banning all religious speech at school graduations, not matter how private the message or how divorced the content of the message may be from any state review, let alone censorship."