I've personally done both, and each have their pros and cons... per usual
When it comes to a gym you need to make sure you have the conviction to go often and get the most bang for your buck. If I was also going to spend money on a gym I'd like it to have options. The gym I used in the past had classes I could attended, a swimming pool, basketball/volleyball court, tennis court, running track, free weights, machine weights, and all kinds of cardio machines. So I could always vary my workout and try new things! But I also had a buddy to meet me there, which made sure I went 6/7 days a week.
The bad sides to a gym is well finding one you really like. Also distance. The effort of getting to the gym. Cleanliness. Your self confidence of working out around other people and also of course the cost. I'd highly recommended asking for a tour of their facilities before joining any gym.
I've recently moved and I find the gyms out here in LA to be very intimidating, plus I don't know anyone to have a gym buddy or have the budget to go to a gym. So I've recently started working out at home. This is nice because A. I can do it whenever and I don't have to go anywhere. B. No one stares at me while I pretend I'm a beached whale on the floor, and I have my own private shower/no locker room after I work out
The downside is.. it's your home and maybe not conducive to working out, or there are too many distractions at home, or just not motivating enough. Maybe you need to see those other people working out
I recently started the P90x at home and I've been sticking with it for a week now and I'm pretty proud. You really have to think about which one you know you will have the best chance of success at. Because it's really about how hard you work, and how disciplined you are