You need to check if the cart or order contains a subscription product, and when it doesn't, remove Stripe from the available payment gateways.
Something like this should be enough to get it working (untested but has all the right moving parts):
function so23120782_maybe_remove_stripe( $available_gateways ) {
if ( class_exists( 'WC_Subscriptions_Cart' ) && ( ! WC_Subscriptions_Cart::cart_contains_subscription() || ( isset( $_GET['order_id'] ) && ! WC_Subscriptions_Order::order_contains_subscription( $_GET['order_id'] ) ) ) ) {
if ( isset( $available_gateways['stripe'] ) ) {
unset( $available_gateways['stripe'] );
}
}
return $available_gateways;
}
add_filter( 'woocommerce_available_payment_gateways', 'so23120782_maybe_remove_stripe', 11 );
Customised from this gist.