Cardio: Anywhere from 20-45 minutes is a good range. Don't spend more than 30-45 minutes on a machine if there is a wait- most gyms have a spoken/unspoken rule about not using one treadmill/elliptical/bike for more than that. You can do all your cardio on one type of machine, or split it betwen two. I get bored easily so I like to split it
Weights: Generally, machines are more for beginners and free weights are more for advanced lifters. (Advanced in terms of how experienced they are, not how in shape they are). This is because free weights require more from the body in terms of proper form, stability, etc. Machines have you move weight within a certain track while free weights are just that- free. You get more out of exercising, but it also takes more to do them properly.
Generally 3 sets of 12-15 reps is good for toning, while 2 sets of 8 reps of a much higher weight is good for building. (The latter was the rules of thumb when I was a high school athlete and training, may want to check a few more sources to be sure).
Some people do cardio and strength every day, alternating which parts of the body they strength train (i.e. arms on M W F and legs on T Th, abs every day). Some do cardio M W F and strength T Th.
I'd strongly encourage you to check to see if your gym has a personal trainer you can either access for 1 free trial session. Usually gyms have these offers, or can accommodate such a request. Use this session for the trainer to guide you through the machines/weights, showing you the right weight and form for your body. He/she can help you figure out a circuit routine you can then do on your own. If your gym doesn't provide a free trial session, ask to pay for 1 session. It is an investment that is totally worth it to help you figure out your way around the gym. Once you have one session you can be off on your own.
Good luck!