So you use "wiem" if you are aware of something, if you have knowledge of something.
For example "I know a lot about biology" - "Wiem dużo o biologii", "I know it's true" - "Wiem, że to prawda"
And you use "znam" if you know somebody, something.
For example "I know Kate very well" - "Znam Kate bardzo dobrze", "I know the lyrics of this song" - "Znam słowa tej piosenki".
I hope you understand now :)