Application Insights tracks dependencies by instrumenting the code that makes the call to said dependency. In short, it captures the start and end times of the call; therefore, the duration is cumulative.
In your example above, the 300-millisecond duration will include the time it takes to connect to the database, execute the query, and send the results back. This holds true for other dependencies as well, e.g. HTTP services, or other Azure Services.