You cant just hit the X like in windows , You can hold the home key and power key for 4-6 seconds and it should close the program . You can also hold the home and power key till the phone restarts . Hope this helps
You can force quit an application. On the iPhone 3GS running OS 3.0, you have to press and hold the sleep/wake button until the red slider appears to turn off the iPhone. At this point, let go of the sleep/wake button and press the home button until you are returned to the main home screen (approx 4-6 seconds). I'm not sure if it's this way for all iPhones running OS 3.0 or just the 3GS because of the Voice Control feature available on the 3GS. To force quit an app in OS 1.x or 2.x all you had to do was hold the home button down for 4-6 seconds until you were returned to the home screen, or springboard.
Rkbrown81 is correct. If you suspect that safari is doing something in the background that woul be how to quit the app. If there is nothing wring then it is no problem closing the app just by hitting the home button.