Is it a sizable overpayment? Is this from an employer?
If it's not a big overpayment, and it is your paycheque, then it is understandable to cash it, as you need to pay your bills, and return the overpayment by cheque. Otherwise, you could contact whoever issued the cheque and have them reissue it. There is a possibility that if they noticed the overpayment, they could have put a stop-payment on the cheque, which means the cheque would come back and the funds could be frozen in your account.
The only issue that would arise for you from a legal perspective is if you cashed the cheque, knowing it was too much and then kept the whole thing hoping they wouldn't catch the error. But again, if you cash it, and return the overpayment, then you've not done anything fraudulent, you've merely received what you're entitled to.
I hope that this information is of assistance to you.
Please take a moment to leave me a positive rating.