You must apply for a National Visa (Type D) for study purposes at the German embassy or consulate in your home country before you travel. This long-stay visa allows you to enter Germany to begin your degree or preparatory studies and is usually valid for the first 90 days, after which you must convert it into a residence permit for study once you arrive.