I'd note that the X-Wing (and a number of other SW ships) doesn't have "wings" but rather S-Foils. These are predominately to hold the weapons on.

Well to spread the weapons out from the body of the ship and each other to give a better spread of blaster fire from them. They also have heat radiators in them and as a secondary effect may help with stablisation in an atmosphere. Most atmospheric flying is done on Repulsarlift and forward thrust however.