Answer: The -se form might be considered the "traditional" form of the imperfect (or past) subjunctive, while the -ra comes from an old Latin indicative form. Over time, the two verb forms came to be used identically. Today, with a few regional exceptions, the -ra form has basically replaced the -se form, and so it is the -ra form you should learn.
When used as the imperfect subjunctive, the two forms are interchangeable. The -se form is sometimes known as a literary form because it is used much less, but there is no difference in meaning.
However, there are a very few cases where the use of the -ra form as an indicative verb form has survived in modern Spanish, although you will seldom hear them. In some parts of Latin America as well as some areas near Portugal, you may hear the -ra form substitute for the pluperfect (e.g., fuera instead of había sido to say "had been"). Also, there are some speakers who use the -ra form of haber as a substitute for the conditional, that is hubiera conocido instead of habría conocido for "would have known"; that usage can also be found occasionally in literature. In these rare cases where the -ra form is used instead of the conditional, the -se form can't be used as a substitute for the conditional. It isn't important to learn these variations, but it can be helpful to remember they exist in case you come across them.
The -ra conjugation pattern for regular verbs is shown below for your reference:
- -ar verbs: que yo hablara, que tú hablaras, que usted/él/ella hablara, que nosotros habláramos, que vosotros hablarais, que ustedes/ellos/ellas hablaran.
- -er verbs: que yo aprendiera, que tú aprendieras, que usted/él/ella aprendiera, que nosotros aprendiéramos, que aprendierais, que ustedes/ellos/ellas aprendieran.
- -ir verbs: que yo viviera, que tú vivieras, que usted/él/ella viviera, que nosotros viviéramos, que vosotros vivierais, que ustedes/ellos/ellas vivieran.