Prayer is allowed -- and in fact is a protected form of free speech -- throughout the public school system. Students can pray in school busses, at the flag-pole, in student religious clubs, in the hallways, cafeteria, etc.
The one place where prayer is not normally permitted is in the classroom itself when a class is in session. The latter would violate the principle of church-state separation which is defined by court interpretations of the 1st Amendment to the U.S. Constitution.
There has been a long history of conflict over school prayer. During the 19th century, there were continual conflicts between Protestants and Catholics over which version of the Bible was to be used in schools. During the 20th century, there were conflicts over the precise text of school prayers. "In New York, a committee of the State Regents actually tried to invent a 'nondenominational, nonsectarian' prayer that would presumably offend no one (save Atheist or nonreligious families) and still have the effect of appealing to an unspecified deity." Although most state laws which attempt to allow school prayer usually permit the student to excuse themselves and wait in the hall, the courts still see an element of compulsion. By separating themselves from the rest of the class, the student risks later harassment and abuse by fellow students.
The 1st amendment of the U.S. constitution states that there shall be no law regarding the establishment of religion. The courts view prayer in the classroom to be one example of the government approving one religion over another. Even a student-selected, student-given, non-sectarian, non-proselytizing prayer still carries with it the stamp of approval of the state - i.e. the state approves of, and is seen to promote, belief in God (and whatever other religious content that the prayer might have).