When you exit an app on previous versions of iOS, unless it was one of Apples built in apps, it generally exited immediately. Now, in iOS 4, the app generally stays in RAM. This does not mean the code is running, in general, it does not. The app is suspended in memory, ready to quickly resume when you open it up. There are a few exceptions, though, to that rule:
. . .
Theres no reason to ever manually close an application: if more resources are needed, the system will close the least used one for you. You might not even notice this: the difference between resuming a suspended program, and starting it anew is small, and according to Apple, is supposed to be as small as possible. Free RAM is no longer an indicator of system performance: rather, less free RAM means your phone will feel snappier when switching apps. Its counterintuitive, but its true.
. . .
I dont believe theres a need to even see if an app is even running. Closing applications is a useless waste of time; if something needs to be closed, the OS will manage that. In fact, I dont believe there is ever a reason to know if something is running or not. Switch to an app when you want to use it, leave it when you are done.