You can set privacy settings for your messages here:
vk.com/settings?act=privacy, under
Who can
send me private messages.
After you change your settings, other users will still be able to contact you within a week. The reason behind this is to avoid cases when you were expecting some important information but you can't receive it since the user is restricted from messaging you.
If you can't wait a week, you can block a user (
vk.com/settings?act=blacklist). Once a user is blocked, they won't be able to message you or view or profile.
Keep in mind that group chats aren't affected by your blocked list or privacy settings.