They will soon learn! Tiggy and her brother had a cat flap most of their adult lives and came and went as they pleased during the day and were locked in from dusk.
In the last house we lived in when her brother was still with us, we didn't have a cat flap so they went out in the morning before breakfast and most days chose to stay in after brekkie, they could then go out again in the afternoon when someone was in and as before were brought back in again before dusk. We had a little cat hideout in the garden in case they chose to stay out after brekkie but they very rarely did, cats aren't stupid you know! We also had a former feral (completely untouchable but liked to live in the comfort of indoors and be overfed) and he soon got used to that arrangement too.