In summer are the upper storey flats more hot or the lower storey flats? I have often heard neighbours talking things like in a multi storied apartment, the upper flats are more hot in summer then lower flats (or vice versa?) and similarly for some comparison in winter? and similarly something for basement..
I have never understood these things well, even though people talk as if this is obvious.
So, what all factors cause such differences?
 A: It will depend on a lot of factors.
Summer
Typically, otherwise-identical flats near the top, will be hotter than those near the bottom, for two reasons:
1) heat rises  - so heat will rise from lower flats to upper flats. More accurately, the density of air decreases as temperature rises, so hotter air will tend to rise up through buildings, where convection is possible.
2) overshading is likely to be less, higher up: in summer, most of the heat in a typical flat will come from solar gain (rather than, say, from internal gains from cooking, people, appliances). The more that windows are overshaded, the lower this solar gain is. Flats low down will have their windows overshaded by neighbouring buildings, trees, and so on. Flats higher up will see more sky from their windows; so will have higher solar gain.
Winter
Much of the stuff above, particularly about heat rising, but also about solar gain, still applies in winter: although heating systems may now be the single largest source of heat, solar gains can still be relevant, if there are large south-facing windows.
Basements
Obviously, there's little or no solar gain - there may be some small windows at the footway ground level, but not much. However, as @anna-v says, there is the moderating effect of the ground itself, which acts as a large thermal store. This large thermal mass will act as a seasonal buffer, heating very slowly through spring and summer, and cooling slowly through autumn and winter, thus typically moderating both the hottest summer temperatures and the coldest winter temperatures.
There are software packages, such as Energyplus, and PHPP that can model solar gain and the effects of thermal mass, at any time of year, for any location; but note that will need a lot of input parameters to do a decent job of it.
A: It depends very much on the insulation. The top floor can be very hot in a cement apartments flat  without an attic.
The second consideration is orientation. East facing and west facing flats are hotter, without extra shading and insulation because in the summer the sunlight is strong from morning  until it sets. North facing flats are the best for summer ( and for painters). South facing in temperate regions, where the sun at noon is very high, are OK too. 
Basement flats are cooler because the earth two meters down has a steady temperature less than 20C. 
So a north looking basement flat will be the coolest. Depressing too:no view . A south facing basement flat will  be the warmest in winter and as cool in the summer,since the sun seldom reaches down to basement level.
