I want to know if we can purchase Apex Classes in Professional Edition. I know we can purchase Workflow rules at an additional cost, wanted to check if same is also applicable for Apex classes.
You should consult with your Salesforce account rep to confirm, but I feel fairly confident that the answer here is "no, you cannot purchase the ability to write Apex classes".
If the official feature chart for Sales cloud is to be believed, workflow should not be available for an additional cost either.
Contrary to Andrii's comment, I believe that you can only install packages, that include Apex, in a Professional edition org if that package is managed and has passed the security review. Evidence from the ISVForce docs
Your app can contain business logic such as classes, triggers, email services, etc. written in Apex. As a general rule, Apex is not supported in GE/PE, so it will not run in these editions. However, Apex developed as part of an ISV app and included in a managed package can run in GE/PE, even though those editions do not support Apex by default.
You must be an eligible partner with salesforce.com and your app has to pass the security review. The appropriate permissions will automatically be enabled after you pass the security review.
GE/PE stands for "Group Edition/Professional Edition"
It's quite likely that the easiest (only-ist?) way to get what you want is to upgrade from Lightning Professional edition to Lightning Enterprise edition.