I can't find very clear rules about how adding class levels affects monster CR in the books, or maybe i just didn't understood clearly. I aim to make more memorable intelligent creatures like dragons or giants.
The rules you're looking for are in Bestiary, Monster Advancement, Adding Class Levels:
Step 3: Determine CR
Determining the final CR for a creature with class levels requires careful consideration. While adding a class level to a monster that stacks with its existing abilities and role generally adds 1 to its CR for each level taken, adding classes that do not stack is more complicated.
Table: Monsters with Class Levels gives general guidelines regarding which core classes add directly to a monster's abilities based on its role. Classes that are marked "key" generally add 1 to a creature's CR for each level added. Classes marked with a "—" increase a creature's CR by 1 for every 2 class levels added until the number of levels added are equal to (or exceed) the creature's original CR, at which point they are treated as "key" levels (adding 1 to the creature's CR for each level added). Creatures that fall into multiple roles treat a class as key if either of its roles treat the class as key. Note that levels in NPC classes are never considered key.
It's a delicate process, and at times it's more art than science.
That said, in a nutshell, it's CR +1 per class level (if the class fits well with the original monster), or CR +1 per two class levels (if the class doesn't fit that well with the original monster), or CR +1 per class level if the class levels exceed the original racial HD.