Thanks for your post, & welcome to the Insiders Community! As you may have already seen, this is a great forum to talk about all things travel from sharing your recommendations and experiences to finding out how to get the most out of the Rewards Program. I am one of the moderators here, along with carat and lindseyh. We're here to help, so if you ever have any questions, please feel free to reach out to any of us I've also included a link to our 'Getting Started Guide' just in case you'd like to take a look:
In regards to your question, unfortunately, there is not a universal answer. Some properties you have to cancel a full 24 hours (or more, depending on the property) in advance. You'll find the cancellation policy for a room rate by selecting "About this rate" located on the rate list online.
Not sure if this adds anything to the conversation, but the Marriott FAQ (All your Marriott Rewards questions are answered in this FAQ) states:
"To cancel a hotel reward, look up your reservation and select the option to "cancel." Both your reservation and reward certificates will be cancelled. For all other reward cancellations, please contact Customer Service. All points will be credited to your Rewards account."
It doesn't directly address the OP's question, but seems to indicate that if you are able to cancel your reservation online then all points will be credited back.