You can get an idea on when Apple drops support for older versions of macOS by looking at the history of releases at
Xcode Releases.
Xcode 14 supports macOS 12. Some time during the Xcode 14 life cycle, Apple will raise the system requirements to macOS 13. That will probably occur in early 2023.
Around April 2023 Apple will require that submissions to the iOS App Store be built with Xcode 14. Around April 2024 Apple will raise the requirement to Xcode 15. Judging by Apple's recent history, your current Mac will be able to submit iOS apps to the App Store until April 2024. But there's no guarantee of that.