So in Persona 5 does it matter if I ignore the main missions, do I fail it if I don't do it in time, can I just not do what I want or am I restricted?
You're somewhat restricted.
You'll have to clear out a "Palace" every so often, you'll be given a deadline for this of X amount of days, if you fail to do this it's game over. If you fail you'll get the option to load an earlier save, or have the game take you back in time a certain amount of time. Hold in mind, you need to send a letter to inform the owner of the palace that you've robbed them once you've completed one, so you need to factor some time into that also. Honestly though, it isn't too bad once you get to grips with managing your time. I usually just push as far into each palace/dungeon I can each day until I've cleared them, which will result in you having a bunch of days until the next major plot segment where you can do anything you want. If you work on getting your confidant link with the doctor up to level 5 this will be easier, as it allows you to buy an item/accessory from her which regenerates SP at a pretty good rate, there's also upgraded versions of the item at higher confidant ranks.
There's certain things you can do to help get the most out of your time also, for example there's a confidant you can acquire who you can contact for a 'massage' once you get her to a certain level. This will allow you to go out during the night after visiting a palace, or for a second time that day I believe if you don't visit one.