The Sreemad Bhagavatham has a detailed explanation of the Kali Yuga. Therein is explained the incarnation of the Lord as Kalki.
क्षीयमाणेषु देहेषु देहिनां कलिदोषतः।
वर्णाश्रमवतां धर्मे नष्टे वेदपथे नृणाम् ॥
पाखण्डप्रचुरे धर्मे दस्युप्रायेषु राजसु।
चौर्यानृतवृथाहिंसा नानावृत्तिषु वै नृषु ॥
शूद्रप्रायेषु वर्णेषु च्छागप्रायासु धेनुषु।
गृहप्रायेष्वाश्रमेषु यौनप्रायेषु बन्धुषु ॥
अणुप्रायास्वोषधीषु शमीप्रायेषु स्थास्नुषु।
विद्युत्प्रायेषु मेघेषु शून्यप्रायेषु सद्मसु ॥
इत्थं कलौ गतप्राये जनेषु खरधर्मिषु।
धर्मत्राणाय सत्त्वेन भगवानवतरिष्यति ॥
धर्मत्राणाय साधूनां जन्मकर्मापनुत्तये ॥
शम्भलग्राममुख्यस्य ब्राह्मणस्य महात्मनः।
भवने विष्णुयशसः कल्किः प्रादुर्भविष्यति ॥
When the bodies of all living entities are in decay from the contamination of Kali-yuga, when the dutifulness of the members of all status-orientations is lost, when the Vedic path for all man has changed into a predominantly atheistic sense of duty, when the kings mainly consist of thieves and the people in their various occupations are lying criminals of useless violence [against specially animals], when the societal classes as good as all are engaged in profit-minded labor, cows have the same value as goats, the hermitages hardly can be distinguished from materialistic households, family bonds do not reach beyond the ties of marriage, when the plants and herbs are mostly small sized and all trees are small, when there is always lightning in the clouds and the homes are ruled by loneliness [voidism, impersonalism], when Kali-yuga is running at its end and the people behave like asses, the Supreme Lord will descend in the mode of pure goodness to defend the dharma.
The spiritual master of all the moving and nonmoving living beings, Lord Vishnu, the Supreme Personality and Controller of All, takes birth for the protection of the religion and to put an end to the karma of the saintly souls.
In the village of Shambhala Lord Kalki will appear in the home of the great soul, the eminent brahmin Vishnuyasha.
So Lord Kalki will appear when the Dharma degrades and everything seems to fall apart. He will appear to re-establish righteousness and justice.