Most recipes suggest a third to a half cup of sour cream for every 16 ounces of beans. You don't want to use much more than that, or your refried beans will be too smooth and soft.
It's best to make your refried beans from dried pinto beans, although black or red kidney work too. Soak and cook the beans, which can take anywhere from one to three hours.
After the beans are nice and soft, sauté onions, garlic, and jalapeños if you'd like some spice. Mix the veggies with the cooked beans and mash everything into a paste.
Finally, thoroughly mix the sour cream into the beans. You can use Greek yogurt instead to keep things a bit more healthy, and cheese or sauce on top always improves the dish.