Delete back ups more than 2 weeks in sql server
Yes, it looks like you're using Ola Hallengren's backup scripts which operate in hours, so 14 days * 24 hours = 336 hours. 

Every time this is run, a full backup of the user databases will be taken and any copies older than 2 weeks will be deleted.

Edit:

Based on the OP's edit, you are fine to schedule a job executing your first script as a replacement for the second script you posted. The frequency of this will depend on your backup and restore needs for your business.

As Kris said, this delete only occurs after a successful backup unless you specify the parameter @CleanupMode = 'BEFORE_BACKUP'