First-time home buyer guide may be worth a look
assuming you are (or where you're planning to buy is) in england - as
danny la rouge has pointed out, a lot of the law round this is completely different in scotland. i've no idea about n ireland or wales.
you'll get more space for your money with a flat, flats are almost always leasehold (you effectively own the inside of your flat, but the freeholder owns the whole building), but you will need to budget for ground rent and service charges (these are usually annual costs, although can often be paid monthly or quarterly) - i'm in an ex council flat and pay 90 quid a year to have the grass in the communal garden cut badly a few times a year, but with some flats i've seen for sale, the service charges can be 100 or more a month for goodness knows what.
and if there are major repairs to the whole building, you will be liable for a proportion of them. if it's a big building with lifts and where doing anything would involve loads of scaffolding, then this can get expensive. see also cladding issues following the grenfell tower fire.
also, once a lease gets below about 80 years, mortgage lenders get reluctant to touch it, so if you're in a place with a dwindling lease, you may have to come up with money to extend the lease so the place is sellable.
flats may be 'share of freehold' so that the freeholder of the building is a consortium of all the leaseholders, possibly through a formal management company / committee or something like that. i've never experienced these but would imagine it can occasionally get complicated if you get one or two twats involved.
leasehold houses (an increasing number of new developments are sold like this) are an out and out rip off.
likewise, you tend to get more space for your money in an older house, although may come with more maintenance costs, be more expensive to heat and so on.
then there's the question of whether prices are going to come down with a bump in the new year, or whether government will find a way to keep the bubble inflating.