Look for some value in your app's preferences, or the existence of some file. If you don't find it, your app is running for the first time, so write the expected value to the preferences or create the file so that the next time your app runs you'll know that it's not the first time.
If you store the time and date of the first run instead of just a flag, you can determine how long it's been since the app was used. You might want your app to act like it's the first run if the user hasn't used your app in a very long time.
Note that this technique only works if the user hasn't deleted your app. When an app is deleted, all its data is removed. If you want to know if your app has ever run on that device before, even if it was deleted afterward, you'll need to record information to identify the device elsewhere, such as on your own server.