Hi! Both are ways of reading a Kanji. Onyomi are readings that came from China together with the characters: There might be one, two or more for each character. However, they now use Japanese phonetics.
Kunyomi are native Japanese words that the Japanese decided to associate with certain characters. This is a bit more chaotic and less predictable than Onyomi.
And yes, you have to learn both.