4 Answers, 1 is accepted
It's kind of in the middle of the two. Specifically when the time is up for a load test, the Load Controller (or Scheduling Server) will send a Stop message to all of the running virtual users (each VU is running in a separate thread). Each VU thread will terminate as soon as it finishes the current request/step and is able to send the latest statistics to the Load Reporter for data collection.
So you see, it's not an instant terminate, but neither is it "stop at the end of the sequence contained in the User Profile" either. That's why it usually runs a little beyond the specified duration, but it should be for no more than a few seconds (depending on how fast the web server sends the responses to the outstanding requests).
Does that answer your question?
Do I have the correct understanding?
Yes it sounds like you have the correct understanding. In the end the number of records inserted will be variable/random due to the random nature of how long it takes for responses to come back, random delays of our Think Time in the load test, random CPU load in the load agent sending the requests causing small delays, network congestion, and so on. A load test run for 8 hours with 100 VU's, and a profile that normally takes 5 minutes to run, you could get anywhere from 7600 to 11000 records inserted.