There are a few culprits when dealing with runny frosting. Either the butter was too soft, you left the frosting at room temp for too long, or you beat in the cream cheese earlier in the recipe (it must be added last). Sugar will pull moisture from cream cheese, so adding it to any frosting at the very end is important to maintain the structure of the frosting. Pop the whole bowl of frosting (or your cake) in the fridge or freezer at any time, for anywhere from 20 minutes to 2 hours, depending on how bad it is, to firm the frosting up.