Penalty time is 5 minutes for each incorrect solution you submitted for problems you eventually solved. Finish time is equal to the time it took you to first correctly submit to your last solved problem measured from the start of the round plus penalty time.
For example, if you have made the following submissions and let's assume each problem is worth 1 point for simplicity sake:
[2m10s] Wrong Answer for problem A. [5m39s] Accepted for problem A. [11m35s] Compile Error for problem B. [19m3s] Time Limit Exceeded for problem B. [19m8s] Internal Error for problem B. [20m45s] Accepted for problem B. [23m32s] Wrong Answer for problem B. [24m3s] Accepted for problem B. [30m4s] Wrong Answer for problem C.
Penalty time = 10m [1 Wrong Answer for problem A + 1 Time Limit Exceeded for problem B]). Note that penalty time due to 1 Wrong Answer for problem C is not counted because you did not solve C yet. Submissions that are judged as Accepted, Compile Error, Internal Error, or Timeout do not add to your penalty time.
Your score will be 2 (according to the earlier assumption of 1 point per problem), with 30m45s finish time (including the 10m penalty time).
Note that submitting a solution to a solved problem does not affect your finish/penalty time.