When should user be prompted for push notifications and location

Location service provides access to user location.

If application has map screen, you could ask user for location service access at map screen.

If application has an event journal screen, you could ask user for push notification service access at this screen.

But, in general, when and where you should ask user for access to push notifications and location services?