Yes, it can mean both. You can safely rely on context. If you ask your relative to not forget to "close" the door when they leave the house, you can be sure they understand they should lock it. Also, if you are too lazy to lock the door when there are still people at home, «закрывайтесь!» is enough to let them know you have left the house and they should lock he door now.
There is another verb, «запереть» (imperfective: «запирать»). If you command «Запри дверь!» it unambiguously means you want it locked. However, good old «закрыть» is a lot more popular a verb.
Igor is right, it's interchangeable by context and Закрой is much more popular than Запри. But sometimes using закрой and not замкни leads to misunderstandings. For example we argued a lot with my girlfriend about it, when I asked her: "Ты закрыла дверь?", when I thought it is clear by context that it is about locking the door and not simply closing. She often responds yes and I find it unlocked afterwards. Argue incoming. That is weird, but considering unclear context and subjective perception it's better to use закрой when you mean just closing and замкни when you mean locking. it's much clearer.
I don't think we use замкнуть in the meaning "to lock" nowadays. People will probably understand you after a second or two but запереть is way more popular. Замкнуть, I think, survived in dialects and in speech of very old people: I found a few examples written in the second half of the 20th century in the corpus.
They end in -й / -йте if the imperative stem (the они form without the ending) ends in a vowel. If the imperative stem ends in a consonant, the endings are -и / -ите or -ь / -ьте. The former for stems ending in more than one consonant or if the я form of the verb is stressed on the ending. Otherwise, the later.