You class dictates how many skill points you gain per level on level up. You can spend skill points whenever you like. During Downtime, you can retrain a skill, losing one tier of proficiency and refunding all your points.
Refer to the table below for the amount of skill points required to increase proficiency.
Untrained -> Trained: 1 Point
Trained -> Expert: 2 Points
Expert -> Master: 3 Points
Master -> Legendary: 5 Points
Unless stated otherwise by your class, you can only progress to this proficiency tier as stated
Untrained -> Trained: Level 0
Trained -> Expert: Level 3
Expert -> Master: Level 7
Master -> Legendary: Level 14