How can I limit the renewal time

For each different subscription, I have a different length or program. So I want people paying monthly but only for 12 months 9 months or 3 months….

How do I set that up so I do not have to give refunds wen it is done?

Or do I have to go in and cancel their membership?