All students from non-EU countries need to apply for visa, prior to their arrival in Greece.
You should contact the nearest authorized Greek Embassy or Consulate and receive information regarding all the necessary documents, as well as the formal application procedure. It is advised to start the visa application process as soon as possible, since the procedure usually requires a considerable amount of time.
Greek Missions around the world can be found at:

A Letter of Acceptance is required for visa, issues by the MTIM Secretariat and sent both by e-mail and regular post.
The students need to go in person to the Greek Embassy or Consulate in their home country and hand in the required documents, as well as the Letter of Acceptance.

Residence Permit:

Once in Chania, students who are going to spend more than 3 months in Greece must apply for a Residence Permit at the:
Immigration Office of Chania
27, Therapeftiriou St. (near MAIX), 732 00, Chania
Tel.: 28210-23806, 23807, 23809, 23810, 23811,23813
Fax: 28210-23820
For the list of required documents, please consult the Immigration Office at your first visit.
The MTIM Secretariat will provide the students with the necessary certificates for their application.

Useful links:

Ministry of Foreign Affairs | Visas

Countries requiring or not requiring a Visa

Greece National Visas and Residence Permit

Visa & Residence Permit guide for students | Please read the section under the title:
Studies in Greek universities (undergraduate, master and doctoral level)
Type of Visa: National-D (Category “D.1.1 Studies”)