'Agree with..' means that you share an opinion. It's usually followed by a noun. You can agree with a person: 'I agree with you', or with a thing: 'I agree with this statement/policy/idea'.
'Agree to' is followed by a verb. For example, if you agree to do some work, you're saying 'Yes, OK, I'll do it.'