You can BlocK or Stop Non Friends or Strangers to Message You on Facebook.To do this all you need is to follow a simple step mention below.
From the Privacy Settings page – Follow the “View settings” link under the “Connecting on Facebook” section of the Privacy Settings page. Adjust the “Send you Messages” setting.
However we recommend you to allow everyone to message you on facebook ,If you block this option from non-friends then there is no chance for anyone to connect you or message you.
If you are getting message from particular person then you can ignore that person ( go in his/her profile and click block this person link ) and he/she will not able to message you again in future.