OLG in DSGE?

Hi,

I am a beginner in Dynare (and DSGE). I do appreciate if someone could answer me, how many years do I need as minimum time period for using OLG in DSGE? What is the deference between optimization in the OLG and in the DSGE models?

Thank you very much.
Tom