TikTok has introduced a feature to stop teenagers using the app at night and encourage them to wind down.