If you have an iPhone 5S or later, the phone measures your activity during the day automatically. Activity is your amount of steps since your last sleep session.
You do not have to keep the app running to measure steps, the phone does this automatically. If you do not want the phone to measure this please go to:
iOS Settings -> Privacy -> Motion Activity← What does Activity and Steps mean?