For an autorenewable subscription you can send any receipt to the Apple servers and they will respond with a latest_receipt and latest_receipt_info field. Those fields will contain a cancellation_date field if the purchase was cancelled. Note that a cancelled purchase is different from cancelling the next autorenewal of the subscription.
For a non-consumable IAP or a non-renewing subscription you do not get that latest_receipt or latest_receipt_info field back from the Apple servers. To get a new receipt you have to referesh the receipt using one of those functions.
> If I have to call SKReceiptRefreshRequest to get the updated receipt,
when is the best time to do it?
Because it will require a log-in to the App Store you need to tell the user you are doing it. The best time is when the user tries to use something that requires the subscription/non-consumable. Post an alert saying that the app needs to check their subscription and give them the option of saying "not at this time". Remember that cancellations are rare and your users fall into 4 categories - paid, cancelled and no longer using, cancelled and still using but won't pay again if caught, cancelled and still using but would pay again if caught. So ask yourself whether the pain to all your loyal users is worth the value you would derive from preventing a small amount of thieft.
And ---- if you want to detect the more frequent user who "cancels" the autorenewal (not cancels the subscription) then you are not looking for a cancellation_date field and what you can do is wait for the current subscription to expire, issue that alert and do a restoreCompletedTransaction. In the future, after a restore, the App Store will send a renewal notice to updatedTransactions each renewal period if you do an addTransactionObserver.