Question says it all
Ctrl + t then enter gamemode 1
if it is not your server it will not work
Gamemode 1 is not OP… No gamemode is OP…
Simply "/ op username" in the console.
Or manually enter in the ops lists.
For a server:
in the console enter "op player name" (without ", replace player name with your Minecraft name).
Another, who already has OP rights, can do that via the chat: "/ op player name" (again without ").
In a single player world:
If you have not activated cheats while creating the game, you can do this later by pressing Esc and releasing the world in the LAN (of course, activate cheats). You have to do that every time you reboot the world.