'''This is tricky!'''
While your Mac can support a sizable drive like the Samsung 8TB 2.5” SATA SSD physically and within either macOS HFS+ or APFS file systems. Theres more things to consider!
You have the limitations of the soldered RAM on your logic board. So depending on what you have this drive may not be a good fit! You really need 16GB of RAM. If your logic board only has 4 or 8GB of RAM I wouldn’t go higher than 2TB.
The other factor is the I/O speed between your systems storage ports: SATA III (6.0 Gb/s) and NVMe/PCIe x2 5.0 GT/s blade SSD.
To gain the most performance I would install a 512GB or 1TB blade SSD and have your OS and apps on it, leaving the rest of the drive empty! This gains needed performance for the caching of the drive tables.