Recited while sitting in the prayer: in the middle sitting (in prayers of three or four rak'ahs) and in the final sitting, where it is followed by the salawat on the Prophet ﷺ.
Source
HadithNarrated by Ibn Mas'ud. Sahih al-Bukhari 6265; Sahih Muslim 402.