Because discarding cupcakes that you could have eaten is a very sad thing, you need to make sure that this never happens just because you lack the correct information.
You can freeze cupcakes without frosting. To do that, you need to wrap them individually in plastic foil, place them in individual freezer baggies and transfer them into airtight containers.
You can freeze cupcakes with frosting.
To freeze cupcakes properly, you need to be very gentle and careful and make sure you don't leave them squeezing onto each other. Place the frosted cupcakes on a plate and place them uncovered in the fridge for an hour so that the frosting hardens sufficiently to wrap it.
After pre-freezing, wrap each cupcake in plastic foil, place them in individual freezer baggies and transfer them into airtight containers.