Can I write my own OPC server and OPC client for a PLC that want to send and receive real-time data to the server ??
yes you can, sounds as if you only need OPC DA i.e. read/write of values.
How much is easy for a undergraduate student ??!!
It depends, if you want to implement OPCDA 3.0 then you would need some knowledge about COM which could be daunting if you haven't worked with it before. Normally when you create a OPC server you would use a framework from some vendor e.g. Matrikon but if you are on a tight budget you may need to do it all yourself.
Or can I use free software for the server (for example "MartikonOPC Explorer") and for the client to connect to the PLC ??
You can use the Matrikon OPC explorer to connect to your OPC server but normally you want to embedd your client code in a program and do something with the values, the explorer is more for testing
Which Programming language can I use ?
For the server part C/C++, for the client part you are more flexible, any language that supports COM
Alternatively you could implement an OPC UA server instead, OPC UA is platform independent and pretty much language independent.
See more at opcfoundation.org