There are 2 ways to achieve this, either from the Scripts tab or from the Triggers tab.
1) From the Scripts Tab:
Then, drag the script you are interested from the left panel and drop it in the central panel.
As soon as there is an active Script in the central panel, the right panel will show various buttons. Select the "Trigger" button to link your Script to a Trigger:
An interface to setup your trigger will show:
The Script associated with this Trigger is already pre-filled. The description of the other fields is found here.
2) From the Triggers Tab:
Select in the left panel, the new trigger Icon:
An interface with the Trigger setup will show. This time, the script ID is not pre-filled.
Right click on the Scripts tab and open it in a different tab in your browser (it will be easier to copy and paste). Drag and drop the Script you want to link with the Trigger and select and copy the ID using Ctr+C:
Go back to the Trigger interface and paste the ID in the proper Script ID field. All the other required fields still need to be filled. For a full explanation of the Trigger interface, see here.