How long should you brush your teeth if you are using retainers after invisalign treatment? I only wear them at night. 2 minutes or 5 minutes?

2 minutes 2x/day. You moved your teeth 24h/day. You need to retain them 24h/day for a year or thy will destabilize. More important w clear aligner Rx than w braces as aligners less efficient than braces in what Orthodontists call "finishing detail." As a result, aligner cases are less stable.
Until clean. Typically it takes at least 2 minutes to effectively brush your teeth - even with electric toothbrush, which is proven better than manual brushing. (Sonicare and Oral -B most common).Then you must clean between the teeth -- floss, proxabrush, go-betweens, etc--whatever works best in your mouth. Can also add water-pik for utmost effectiveness. Remember, only clean the ones you want to keep. Good Luck.