I am in Afghan national, holding German residence permit, live in Heidelberg of Germany. Can I myself, who does not have a German citizenship but still German long-term permit, get a eVisa of Turkey on arrival?
Nobody can get an "eVisa [...] on arrival". eVisa's are issued in advance via the website at Turkish e-Visa Website. Turkey does also issue normal visas on arrival, but they are generally more expensive and higher risk, so e-visas are generally better.
The best way to tell if you are eligible for an eVisa is to visit that site and attempt to apply for one. During the process it will ask you a number of questions, and based on the answers it will confirm if you are eligible for an eVisa or not.
In your specific circumstances (Afghan citizen with a residence permit for a country in the Schengen region) you ARE eligible for a single-entry visa that will allow you to stay up to 30 days.
Your German wife and children are exempt from holding a visa for stays of up to 90 days.