yaru means that you give something to someone whose social status is same or low to you, so ”私は先生に本をやった" is not good.
ageru is a polite form of yaru or ataeru"与える".
kureru usually means that someone gives something to you.
For example, ”彼女は毎月手紙をくれる”.