This depends upon your budget. If you can afford to buy a villa then go with villa. Added benefits to villa when compared with apartments are luxurious space, independence, extra amenities etc.
Buying a villa or Flat depends on budget and the place where your living whether in city or Town......If your staying in city better to buy flat which has more security...
If you are in center of city please pick the option of going to purchase flats because it will more suitable for the city condition and if your are not in the city outer of city then you can go for villas as it is more suitable for that situation and place.