To make a program your default; right click any .torrent file on your computer, "properties", go to "open with" tab. Choose the program you like and set it as default.
This would set the default program to open .torrent files, but it would not change the program that opens magnet links (sadly).
Setting the program that opens magnet links is a little bit harder. Try to follow this or try following me:
Firstly we need to check that your program's ".desktop file" (in
/usr/share/applications) has this line:
To check, open the text editor (called gedit) and hit "open" up to the left, then navigate to your program's .desktop file. As stated; you should find it in the folder
/usr/share/applications. After you open it, search for "MimeType" (by pressing Ctrl+f and typing "MimeType" in the box that shows up).
...If you did find that it has this line then proceed. (if not then just put the line in. Modify the existing line.) Close gedit.
Now that we've done the checking; open the file
/usr/share/applications/defaults.list (the same way you opened the .desktop file). Search for "x-scheme-handler/magnet" (same way also). If you found it, make it look like this;
Replace YOURPROGRAM by the program you want to set default. The name must exactly match the name of your program's .desktop file.