How to delete a credit card of iPhone?

I want to buy an app off AppStore and then delete it off there after I buy it

Not really, after you create an apple ID to purchase the app the credit card will stay unless is is switched (you may be able to delete an apple ID, go to apple's website). You still need the apple ID to buy music and other things and it will always ask a password before downloading anything so it's secure. Hope this helps!