Learned helplessness is a widely accepted reason why people get depressed. Surgery can make us feel quite helpless if you think about it. With doctor's approval, get activated.
Depression does not have any time limit. Some people are depressed only for a short while, while others suffer for many years or decades. So, only time will tell in your case.
After having surgery it is not uncommon to have some depression. If one is unable to function and has thoughts of harm to self or others seek psychological help.
A state of depression is very natural following a surgery and typically lasts only a short time. In some cases, however, it may be prolonged and last an indefinite amount of time if not treated.