I would only recommend baking the cupcakes 2 days in advance and then preferably frosting them on the day you wish to eat them. If you want to make them ahead of time any longer than 2 days, I would recommend freezing them unfrosted and then frosting them once they have fully defrosted.