Yes, you may subscribe to any subscription plan for just 1 month, or any number of months you wish to. (The exception to this is the Enterprise Plan, which has a minimum of 1 year subscription)
Your subscription can be upgraded, downgraded or cancelled at any time. There is no fixed period you have to be subscribed.
It is to be noted, though, that at Ahrefs, we have an automated recurring billing system: at the end of each paid period, your subscription gets automatically extended for the next period.
Thus, if you plan to subscribe for a month only, be sure to cancel your subscription after your monthly subscription is purchased, before the renewal date.
You may do that from the Subscription Plan tab of your personal account at Ahrefs. Check this Help article for more detailed instructions.