Use an electric mixer to mix cream cheese and butter until creamy and light, about three minutes on high speed.
Mix in powdered sugar one cup at a time. You can add more or less to get your desired consistency.
Mix in vanilla until fully integrated.
Spread or pipe onto cooled cake or cupcakes.
Notes
This recipe frosts a two layer 8" cake or 24 cupcakes.
Always make sure that all ingredients are at room temperature before starting.
Mix for several minutes to incorporate lots of air into the frosting and make it fluffy.
You can add more or less powdered sugar to the recipe to give it a lighter or stiffer texture.
The USDA considers frostings made with cream cheese to be unsafe if left unrefrigerated for more than a couple of hours, and there are a lot of food websites that echo this fear. If you have a weakened immune system, or just like to err on the side of caution, then by all means refrigerate your frosting until you are ready to serve. If you want to know what I do, though, I leave my cakes and cupcakes with cream cheese frosting out of the fridge. I have never had problems with the frosting souring, and I have certainly never had any negative health effects.
Cream cheese frosting can be frozen! Foods with a high fat content tend to survive freezing well. You can put a plastic bag of cream cheese frosting in the freezer for weeks or maybe even months. You will need to let it thaw and re-whip it a bit when it comes out, though, before you start piping.