TestDisk operates with the assumption that your files are intact (as in it was only deleted or formatted, and not overwritten by new data), which makes it an efficient tool to recover files that you sent to the trash bin or that were lost due to accidental formatting. It simply looks for the file in your file system and pulls it back out.
PhotoRec operates with the assumption that your files are corrupt and/or fragmented and will conduct deeper scans to recover the pieces and put them back together. PhotoRec takes longer to recover files and can be overkill if you just accidentally deleted a file – but it’s a great tool for advanced recovery.