Dear @Hadil N,
according to the Federatl Office for Migration and Refugees of Germany, if you want to stay in Germany up to 360 days and you already have a residence permit from Italy, which is valid for the entire duration of your stay in Germany, you don't require a German residence permit. However, your must contact the department of foreign students in your University in Germany, so that they can apply for a certifcate of a declatory nature in the Federal Office for Migration and Refugees of Germany for you.
Here you can read more about https://www.bamf.de/EN/Themen/MigrationAufenthalt/ZuwandererDrittstaaten/MobilitaetEU/MobilitaetStudent/mobilitaet-student-node.html;jsessionid=B701358A618138C34FEDFBBBE4B23302.internet532
For stays of more than 360 days you need a residence permit of Germany and there is another procedure for it. In the above link, you can find some details about it. Nevertheless, in this case also, I would recommend you to contact the department of foreign students in your University in Germany. Because from you question it is not clear enough if you want to do a one or two semesters of your Masters in Germany and stay less than one year here?/Are you coming based on an exchange program between your current university and the university in Germany? Do you want to do your Masters in a new field? Or you want to do your PhD in Germany?
You can also get back to us by providing more clarification about your question.
I hope my answer was useful for you and I'll be very pleased if you contact me again with further questions. I'm a member of the MBEON-staff and I‘ll be glad to guide you over a longer period of time. Mbeon is an online consultancy for migrants via the mbeon-app, which you can install on your smartphone for free. Download it via App Store or Google Play Store. You'll find me In the mbeon-app under my name „München, Herr Noori“ and get confidential one-to-one advice in a safe virtual room where nobody can wiretap messages. Further information: www.mbeon.de.