If you choose to cancel your subscription, you will maintain access for the duration of your current billing period. For example, if you're on the monthly plan and were last charged on October 12th, you would maintain access to the course content until November 11th.
The same applies to the yearly plan even if you cancel immediately after being billed. For example, if you are billed on October 14th, 2019, and cancel anytime during the year, you would maintain access until October 13th, 2020.
Note that during this time, your Status on your My Subscriptions page will list your subscription as "Pending Cancellation" to denote you still have access. At any time after cancelling, however, you are free to resubscribe before the next billing period.
For more information on how to cancel your subscription, please see the following article: How do I cancel my subscription?
Important Note: Even if you cancel your subscription, you will never lose access to individual course purchases, old curriculum purchases, or bundles purchased outside of the subscription (such as through Humble Bundle). You will be able to continue learning from these courses as much as you would like.