I am a Mexican student that will do an exchange to Italy.
Can I apply for a student visa when I am in Italy?
Applying for it in Mexico will result in a delay of my arrival.
According to Ministry of Foreign Affairs it will need to be submitted to "Italian diplomatic-consular post", which is consulate or an embassy:
Where do I submit my visa application and who needs to submit an application?
The organisation responsible for issuing visas issued by Italy is the Italian diplomatic-consular post in your place of habitual residence or origin. This is the only organisation authorised to evaluate and verify that you, as a foreign national, meet the requirements to obtain a visa.
Uniform Schengen Visas. For Uniform Schengen Visas (both for transit and for short stays), if Italy is not your only or principal destination, you should submit your visa application to the diplomatic-consular post of the Schengen country that is your main destination.
If it is not possible to establish which country is your main destination (for example if you are making a journey with stays in different Schengen countries), the diplomatic-consular post of the first Schengen country you plan to enter will be responsible for issuing the visa.
If your destination Schengen country does not have a diplomatic-consular post in your country of residence, the Schengen visa can be issued by the diplomatic-consular post of another Schengen country that represents your destination country.
National visas. It is the diplomatic-consular post of the Schengen state that will be your long-stay destination that is responsible for issuing your national visa.
For national visas, there are no agreements in place for one country to represent, and issue visas on behalf of, another country in a foreign national’s country of residence.
You must submit your visa application in person to the appropriate consular office, usually by appointment.