Students were sentenced by a court in Ankara for violating the law by disturbing Erdogan, who in the performance of his duties during his visit to the Middle East Technical University, according to the official news agency Anadolu.
Erdogan had visited the university to attend live via a video link to the launching of a Turkish satellite observation by a Chinese rocket.
Security forces then dispersed with tear gas and water cannons to students who demonstrated against his visit.
The opposition had criticized the police intervention, considering that it was too violent for a relatively minor event.
Erdemir Aykan a former deputy of the Republican People's Party (CHP, the main opposition formation), criticized the court's decision.
"It is sad to see that prison sentences are always the preferred response of the Turkish government to criticism and student demonstrations," he told AFP.