You can use Third Eye for Android.
Their feature list includes, quoted from their list:
- The app automatically takes a photo while someone enters the wrong
PIN, Pattern or Password.
- Notification about wrong attempts while you unlock the lock screen.
- Last Unlock Time feature will show you the previous lock screen
unlock time. With that, you can easily find if someone used your
mobile without your knowledge.
- A detailed photo logs of the mobile snoopers.
- A lot more customization settings.
Additionally for windows, as mentioned by batistuta09, you can check login attempts in the event viewer on windows. The guides below are helpful if you don't know how to use the event viewer.
Check Successful or Failed Windows Login Attempts
How to See Who Logged Into a Computer (and When)