For Facebook, the optimum size is 2048px on the longest edge (either high or wide). For other websites, you'd need to investigate to find out their optimum size. Use the Image Size function.
In this example I'm preparing a photo for Facebook, and it's a portrait (tall) photo, so 2048 is my height:
It's really important to have the "Resample" box checked, and set to "Bicubic (smooth gradients)" as I have done here.