A villa is an independent house with or without a compound wall depending on whether you're staying in an enclosed compund already.

If you are in an enclosed compund already there is a possibility that the villa will be an independant house without a compund wall.

 In villas like these you could have facilities like a pool/gym etc  like Lacey said.

A flat is a small house in a building with other flats or houses.

The building is usually called an apartment or sometimes apartment is the same as flat.

Its like a bunch of flats constitue an apartment.