Given your description I think it unlikely your account has been compromised, but if you think it has then read this support article --> https://support.apple.com/102560
Was this a new Mac, or did it have a previous owner or has anybody else used your account on this Mac? One reason for being asked for a different account is if somebody else downloaded an app with their account. To update apps you have to be signed in with the same account. Go to the App Store app and check who is signed in at the bottom.
If this is a secondhand computer, it may not have been properly reset for resale --> This support article describes what to do before selling or giving away your Mac. --> https://support.apple.com/102773