Who is allowed to apply for German Staatsbürgerschaft (citizenship)?
In principle, all foreign nationals who have legally resided in Germany for at least 5 years, hold a permanent Aufenthaltstitel (residence title), affirm the free democratic basic order, can support themselves, speak German at least at B1 level, and have passed the Einbürgerungstest (naturalization test).
These are the core requirements under § 10 StAG (Nationality Act). Details and exceptions at Requirements.