Gems and ores are use for weapon, armor and accessories enchantments. You can start enchanting gears with come with enchantment slots once you locate the black smith in broken valley, which is just beside the wishing well.
If you really run out of space and in need of gold, you can sell them out if you want. Just dont sell any malachite gem. You can sell malachite ore but not malachite gem, as its use for rank 10 enchantments, and its rare as well. You can obtain the rest of the materials back later once you obtain battle tower, where you had your own runners to collect those raw materials for you, which only malachite gem cant be collect by runners.
Beside selling off loads, you can also add some points into encumbrance skill if you want. Each point adds 20 more item slots. You can unlearn the skill later also once you obtain your battle tower.