You may cancel at any time during your billing cycle at no cost. To cancel a subscription you can either downgrade your subscription to the free plan or simply delete the account or organization holding the subscription. To downgrade you might need to delete or reduce the usages of your projects.
When cancelling the subscription any overage is tallied and charged immediately.
You can request a refund for a plan within 15 days of purchase. Refunds are issued to the card that was originally charged and may take up to 10 business days to process.
If you are not sure how long do you need the subscription for, then use the monthly subscription, it's normally more expensive but you get more flexibility to cancel.