Yes, students have the right to pray and discuss religion in school. Public misperception has persisted on this topic since the U.S. Supreme court struck down school-sponsored prayer in the early 1960s. In those decisions, the high court ruled that the establishment clause does prohibit schools from allowing or engaging in school-sponsored prayer or encouraging students to pray.
But the free-exercise clause protects the rights of students to pray on their own time. In fact, singling out student religious speech for punishment would indicate hostility towards religion and violate the basic First Amendment principle that the government may not punish a particular viewpoint.
This does not mean that students have an unfettered right to speak on religious subjects. Students can be punished for interrupting class time for any type of speech. Also, school officials can make sure that students are not speaking to a captive audience or harassing others by overzealously advocating their religious beliefs.