Use Konjunktiv I in reported speech and Konjunktiv II about unreal or unlikely events (e.g. talking about the past).
Er sagte, ich solle Konjunktiv 1 nur in der indirekte Reden benutzen. Hätte ich das vorher schon gewusst, hätte ich die Frage nicht stellen müssen.
Translation: He said, I should use K1 only for reported speech. Had I known this before, I wouldn't have had to ask the question.
First, take a look at inflection tables and you'll figure out what the right Konjunktiv I (K1) and Konjunktiv II (K2) forms are:
K1 | K2
haben er habe | er hätte
sein er sei | er wäre
essen er esse | es äße
You see that you used the K2 form only.
There are a few use cases. Besides some fixed expressions ("Es lebe der König"), you often see it in recipes.
But the main use case is reported speech. Similar to English, when you quote someone, you have to adapt the pronoun and verb. Unlike English, however, you don't care about the tense of the main clause ("He says" vs "He said") and you always use the same form — K1 that is.
For the sake of completeness, however, note that in colloquial German we often replace K1 with a "dass"-clause in indicative mood.
A: "Du lernst Deutsch." (You are learning German.)
B: "A sagt(e), du lernest Deutsch." (A says/said, you are/were learning German.)
B: "A sagt(e), dass du Deutsch lernst." (A says/said, that you are learning German.)
For further reading, you can find a lot of reliable sources that explain the use of K1. Here are a few ones:
The main usage of K2 is when it comes to things that are unrealistic or unlikely. This corresponds to conditional types two and three in English.
Ich wünschte, ich wäre nochmal 20. (I wished I was twenty again.)
Ich dachte, ich hätte dich gesehen. (I thought I had seen you.)
Hätte ich nicht verschlafen, so hätte ich den Bus nicht verpasst. (Hadn't I overslept, I wouldn't have missed the bus.)
Wenn ich nicht verschlafen hätte, so hätte ich den Bus nicht verpasst. (If I hadn't overslept, I wouldn't have missed the bus.)
For further reading, browse the sites I linked for K1 and you find more information about K2, too.
I left out a few details to not complicate things. For a very thorough understanding of the whole matter, I highly suggest reading the articles on Canoonet.