No, don't support your weight on your arms
Your hands simply aren't really made for supporting all that weight. If you ride for long like that, you'll see white or red areas on your hands where pressure has affected blood flow. It's also likely to exacerbate repetitive injuries from keyboarding. Gloves can only help a little.
It's ok to be sitting very upright with your weight on your saddle, at least for short distances. This is common on "cruiser" or "comfort" type bikes. A posture with a straight vertical back is bad for your spine when dealing with any kind of bumps, so you probably don't want that kind of positioning on long rides or rough rides.
There's circumstances where you briefly support a good portion of your weight on your hands, but it shouldn't be your default posture on the bike.
The ideal is to bend at the pelvis, keeping your back straight (or arched forward). Elbows slightly bent. Weight on the saddle and/or pedals. Almost no weight on the handlebars. Keeping your back straight makes it easier for your core muscles to engage and keep your torso straight. This is also much easier on your neck.
Meh (comfort bike):
Note that with the curved spine it's hard to keep weight off your hands, and since the top of your back is fairly level you have to crane your neck up to see forward comfortably. This is bad for your lower back, bad for your neck, and bad for your hands. Riding like this for long hurts.
With a straight back, your neck isn't bending back awkwardly, and it's easier to keep weight off of your hands. With your elbows bent it's also easier to keep control of the bars and to deal with rough patches. Your hamstring (and other) flexibility limits how low you can ride with a good posture, and so do the strength of the muscles in your core. You should be able to easily take either hand off the bars without it affecting your steering. You want to be able to push or pull on the bars with either hand.
Awesome (pedaling hard):
If you take the good posture and pedal harder, you actually take your weight almost entirely off of the seat and use your hands to pull yourself down (by pulling up on the handlebars) to provide greater force against the pedals. If your butt starts to get a little tired, shifting your weight to your feet for a little while can help.
Very brief sprint:
If you were racing competitively, you might bend your spine for a brief while to get extra low and aerodynamic, but you'd be likely to still be pulling up on the handlebars instead of leaning down on them. It's ok to do the curved spine thing now and then, just not for long.
If there's rough ground ahead, with the pedals horizontal, you get off the saddle entirely, crouch on the pedals and bend your arms. This position does put a lot of your weight on your hands, but you only do it for a few seconds at a time.
If you need to stop quickly, push your butt backwards off the back of the saddle while keeping your butt low, push yourself back with your hands and push forward extra hard while you pull the brake levers. The combination of bracing against the handlebars and shifting your weight back a little will keep you from going over the handlebars.
You might try keeping your fingers around the bars, pushing your spine forward and taking all of your weight off your hands. Unless you're a really experienced rider I wouldn't suggest taking your hands entirely off of the bars. Practicing like this a little every time you ride can help you get more into the right posture on a regular basis.