A foreign student can get permanent residency in Italy after graduation. Non-EU nationals must get a temporary resident visa prior to their initial arrival in Italy. You cannot apply for a permanent residency permit before that time.