This could be because your butter was too soft or melted. Try refrigerating the frosting for a bit, and then whip it again. If it’s still runny, it could be because you added too much milk or cream. In this case, add more powdered sugar, a little at a time (see my tips above).