No, the film Titanic is not a true story, although it is loosely based on one. This type of movie is known as an historical fiction, which means that the story and characters aren't real, but the historical context is.
What is Titanic based on, then?
The 1997 movie Titanic, directed by James Cameron, is a fictionalised account of the sinking of the RMS Titanic.
The RMS Titanic was a passenger liner that collided with an iceberg and sunk on her maiden voyage. The ship left Southampton, UK on the 10th April 2012, and was headed for New York City.
On the 14th April at 11.40pm, the Titanic hit an iceberg, doing extensive damage to the hull. The ship had split in half and sunk by 2.20am.
An estimated 2,224 passengers were aboard, yet due to an insufficient number of lifeboats, only 710 people survived. Many remained trapped inside the boat, and nearly all who jumped into the sea died of pneumonia or heart attacks from the extreme cold (-2 degrees C or 28 degrees F).
So, which parts are fictional?
The characters. Jack and Rose (played by Leonardo DiCaprio and Kate Winslet respectively) were not real people on the Titanic, and they're not based on real passengers, either. This means that the entire story about their romance can't be true, as the couple didn't exist.