EU nationals only need their passport or national identity card to enter, stay and work in Germany for three months. If you plan to stay longer, you must register with the authorities at the Bürgeramt (Citizens' Registration Office) within two weeks of your arrival.
Citizens of Australia, Canada, Israel, Japan, New Zealand, Poland, Switzerland and the US only need a valid passport (no visa) if entering Germany as tourists for up to three months within a six-month period. Passports must be valid for another four months beyond the intended departure date. For stays exceeding 90 days, contact your nearest German embassy or consulate, and begin your visa application well in advance.
Nationals from other countries need a Schengen Visa, named for the 1995 Schengen Agreement that abolished international border controls between many European countries. Applications for a Schengen Visa must be filed with the embassy or consulate of the country that is your primary destination. It is valid for stays of up to 90 days. Legal residency in any Schengen country makes a visa unnecessary, regardless of your nationality.
For full details, see www.auswaertiges-amt.de and check with a German consulate in your country.