What is the imperfect and perfect tense and how would you use it?

Spanish has two past tenses: preterite and imperfect. Most verbs can be put into either tense, depending upon the meaning.
The preterite is used for actions in the past that are seen as completed. Use of the preterite tense implies that the past action had a definite beginning and definite end. For example:
Juan habló de la una hasta las dos.
(Juan spoke from one until two o’clock)
The imperfect is used for actions in the past that are not seen as completed. Use of the imperfect tense implies that the past action did not have a definite beginning or a definite end.
Las chicas hablaban en inglés.
(The girls used to speak in English.)
The perfect tenses, are compound verbs, meaning that they are actually formed by two vebs working together. They are formed by combining the conjugated form of the helping verb (auxiliary verb) - haber (to have) with the past participle.
The verb "haber" is conjugated depending on who or what is doing the action as well as when, and the Spanish past participle is formed by adding "-ado" to the stem of "-ar" verbs (hablar - hablado, andar - andado) and "-ido" to the stem of "-er" and "-ir" verbs (correr - corrido, mentir - mentido).
For example:
He visto las montañas de Perú.
(I have seen the mountains of Perú.)