Germany has explained how many years foreign workers and other legal residents must live in the country before becoming eligible to apply for citizenship.