What is the difference between the Off-Topic forum and the forums about WoW?
Sorry, couldn't resist. Moved this topic to the Newcomer Forum, where it is more suitable. (edit: actually, Aerath did it, while I was writing this post

)
First of all, there's no shame in not knowing something - we are not some kind of elite forum where newcomers are belittled for their limited knowledge. These are not the official forums, for instance. The expression "noob" does not exist here, only in a non-insulting way. So when you post here, feel free to ask questions.
On a PvP server, you are only safe from being attacked by an enemy player in the first area's, so until you are about level 20. From then on, you will mostly reside in contested area's where you can get attacked by any enemy player in the vicinity, or alternatively, where you can attack them yourself.
On a PvE server, enemy players can only attack each other when they both turn PvP mode on by typing "/pvp". If you don't do that, you cannot be attacked by any player.