I usually ask my team how they would prefer to do the retrospective and planning. Usually the asnswer is on the same day as alhtough, recognising these sesisons as important, they prefer to get to the next iteration as soon as possible.
You may wish to consider things such as:
length of iteration - longer iterations will tend to lead to longer retrospective and planning sessions, which may be too long and draining to get the best value form the sessions.
team experience - experienced teams may be able to get the best value from these sessions in less time and with less strain.
product complexity - a very complex product will require more retrospective and planning time, again meaning that the sessions maybe too long.
The above is not exhaustive, the point is to examine how you do things and try and make sensible decisions that suit you and your team.
Remember, you can inspect and adapt this process too, so you can try different approaches.