You may easily upgrade/downgrade your Ahrefs subscription anytime from 'Account settings':
Where you need to navigate to 'Billing menu' and choose 'Change plan' button:
Or 'Pricing' page:
When upgrading your plan to a higher package, changes take effect instantly. You are issued a pro-rated refund for your previous subscription and charged for a new one. Do note that it won't necessarily be the full charge - the charge for a new plan will cover remaining billing period that doesn't change after upgrade (unless upgrade to another plan is performed the same date after payment went through - in this case you get full refund for the previous plan and full charge for the newly chosen plan is processed).
Again, please, mind that in this case your billing cycle dates do not change.
When downgrading your plan, no refund is issued. Changes take effect at the end of a paid period (you remain on your current plan till your next billing date).
This procedure will work for switching from monthly to monthly, as well as from yearly to yearly subscriptions.