So for full time study the SFE entitlement formula is as follows:
Length of course + 1 year (the "gift year") - number of years previously in higher education.
Assuming you've not previously studied at university level, and the course is offered as e.g. "MSci X with Foundation Year - 5 years" then you will get 5 + 1 = 6 years of funding maximum. So enough for the whole course plus an extra year in case you need to repeat a year, or change course.
If the foundation year is somehow separate or uncoupled (e.g. you're planning to do a foundation year at one uni then continue your studies at another uni - which is always a bad idea by the way) then your foundation year would effectively take up the "gift year" which means you wouldn't be able to repeat a year or change course without having to self-fund tuition fees for a year.
Note when it comes to self-funded years, normally you will still be entitled to a maintenance loan, but not a tuition fee loan. However as SFE calculates from the end of the degree to the start, if there are any years you would need to be self funded for these would come up at the beginning.
For example if on a 3 year course you pass year 1, then repeat year 2, then need to repeat year 2 again, you would not self fund the 3rd year, you would self fund the repeat of the 2nd year, then have full funding for the 3rd year. Something to bear in mind so you don't potentially get caught out (although hopefully should not be a situation that arises for you).
If you do have prior study at university level (whether you were funded by SFE or not) things become more complicated and to comment, you would really need to outline this background.