Google Nexus 7 users can lock their device using the power button or by setting the inactivity time to specified interval.
Nexus users can quickly lock the screen by turning off the device using the Power button available at side.
Specify inactivity period
Users can specify the inactivity time and after the time interval the device will be locked. This option is available as part of the Display Settings.
Tap the Settings icon from the icon list.
In the Settings screen, tap the Display option under the Device section.
This would display list of time period and after the specified time interval the device will be automatically put to sleep.
Also check out how to secure your Google Nexus 7 with screen locking.