A Residency Permit is valid for 10 years and then has to be renewed. There are two different situations that allow you to apply for a Residency Permit. Firstly, they are issued in cases of family reunions. Secondly, they are issued if you have already lived in the Czech Republic for eight years, without interruption.
The application for a residence permit has to be made at any Czech embassy outside the Czech Republic. Only if the applicant has already been in the Czech Republic for eight years on a long-stay visa, the application may be filed in the country directly. A foreigner may apply for the permit if he intends to be living with a Czech citizen who is a permanent resident of the Czech Republic. However, both people have to be related. Some cases of adoption are taken into consideration. However, since these cases are even more specific it is generally advised to check that with your local consulate or embassy.
If you have legally lived in the Czech Republic for eight years without interruption you qualify to apply for a Residency Permit. This is possible, for example, if you have any kind of long-stay visa which has already been renewed eight times.
If you have applied for family reunion reasons, you will be requested by your embassy to provide your passport again. You will then receive a temporary visa which allows you to enter the Czech Republic in order to pick up your Residency Permit. You have to pick it up at an appropriate Immigration Police Office. This will usually be the closest to your accommodation in the Czech Republic.