The majority of healthcare providers do an ultrasound around 20 weeks. The purpose of this ultrasound to so measure the baby to see that he/she is growing as expected. They also look at the placenta, blood flow, baby size and level of amniotic fluid. This is the time when they will also look to see what the gender is if you desire, but it is not the primary reason for the test and if the baby is uncooperative you are out of luck.
Later on in pregnancy ultrasounds are used to check size, fluid level and presentation if there is a question about which way the baby is facing. They do guesstimate the baby's weight with an ultrasound but it can be off up to a pound in either direction. If there has been a problem with the placenta they will check this also to see if the placenta is healthy or has moved.
Ultrasounds are not necessary for a healthy pregnancy, but I don't know how many providers will allow you to refuse it. If you do not want ultrasounds, you need to find out if that is acceptable for your provider. There are no risks that are known with ultrasounds, though many babies do not like them.
I have had ultrasounds with all of my babies and really like them. It's fun to see them and to see how the baby is doing as a whole.