To add a gradient around an object, you must isolate it on a separate layer with transparency. If you want a gradient around the entire image, you can use the Stroke layer effect. It's a bit more complicated than you might expect but still manageable.
You'll need a layer above the image with the Fill set to 0 (just below Opacity in the top right corner of the Layers panel).
Open Layer Style > Stroke, set the stroke to inside, and choose Gradient as indicated in the screenshot below.
Before saving as a JPG, merge the layers. Remember that multiple saves will degrade the image quality due to JPG's lossy compression.
... View more