Set end date when setting up Stripe subscription
What you describe is possible in Stripe, but not as an out-of-the-box solution (as of August 2014). You'll need a little bit of programming logic on your end, too.
First, you'll need to have a web hooks endpoint:
https://stripe.com/docs/webhooks
Next, you'll want to subscribe the customer to a plan like normal. We'll notify your site, via the web hooks, of when payments are made on a recurring subscription. Specifically, you'll want to watch for invoice.payment_succeeded
events:
https://stripe.com/docs/api#event_types
Once a specific customer has hit the right number of payments (which you'll track on your end), you'd then issue a cancel subscription request:
https://stripe.com/docs/api#cancel_subscription
Hope that helps! Larry
PS I work on Support at Stripe.
2020 Update
It is possible by setting up "cancel_at" date when creating subscription. More info Create a subscription with Stripe