In an event. On the last page, in the bottom right corner of an event's command list, there is a command called "Script".
Choose that, and add the call to the text box. You may have to shorten it a bit to something like this:
n = HOTKEY_NUMBER
id = SKILL_ID
$game_player.skill_hotkeys[n] = id
Just replace the values that are written in all caps with your own.