There are contract roles at all levels therefore for all levels and I've seen people contract with 12 months commercial experience (though that was in a good market). That said you'll see more (and better paid) opportunities the more experience you have. Ideally I'd suggest that you're either at or close to senior developer type experience (5 years +) but in most places it's really not impossible with less so long as the market is OK at the time.
In terms of the lifestyle though, some words of warning.
I know a lot of people who went into contracting with the intention of doing a bit of time on a bit of time off and it never worked out that way.
When things are going well the temptation is to keep working while the going is good because there might be a downturn on the way and you should make hay while the sun shines.
When things are going badly you're so nervous about being out of work that you're desperate to get back in a position. Even if you don't need the money in a bad market contracting is a bit "you're only as good as your last role" so gaps on the CV aren't great.
You can make it work but you're going to need to be disciplined and budget for plenty of time out of work to give you the assurance that you're not going to leave yourself in trouble when it comes time to go back and can't find something immediately.
That financial security is the thing that's going to make your goal possible so it's critical to understand what your average wage over time working and not working will be rather than get carried away with what you're earning when things are good.