I saw that for each step in sagemaker pipeline we define instances on which the step will be run. So, after the completion of each step is the instance destroyed, or does it keep on running?
When your pipeline completes, you call stop and then you delete the pipeline. When you delete the pipeline it will destroy all of the underlying resources that was created to execute it.
execution.stop()
pipeline.delete()
https://docs.aws.amazon.com/sagemaker/latest/dg/run-pipeline.html#run-pipeline-delete